FELIX-1199 - Karaf: closing IO stream, removal of minor file descriptor leak.
git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@785868 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
index d417e2f..3c5e66e 100644
--- a/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
+++ b/karaf/main/src/main/java/org/apache/felix/karaf/main/Main.java
@@ -175,7 +175,9 @@
// Start up the OSGI framework
InputStream is = getClass().getResourceAsStream("/META-INF/services/" + FrameworkFactory.class.getName());
- String factoryClass = new BufferedReader(new InputStreamReader(is, "UTF-8")).readLine();
+ BufferedReader br = new BufferedReader(new InputStreamReader(is, "UTF-8"));
+ String factoryClass = br.readLine();
+ br.close();
FrameworkFactory factory = (FrameworkFactory) getClass().getClassLoader().loadClass(factoryClass).newInstance();
framework = factory.newFramework(new StringMap(configProps, false));
framework.start();