switched Makefile to use new Makefile.common
[org.ibex.mail.git] / src / org / ibex / jinetd / Loader.java
index a94365e..5c933c7 100644 (file)
@@ -108,7 +108,9 @@ public class Loader extends Watcher {
             File classFile = slash("BIN").slash(name.replace('.', File.separatorChar) + ".class");
             if (classFile.exists()) {
                 try {
-                    byte[] b = InputStreamToByteArray.convert(new FileInputStream(classFile));
+                    FileInputStream fis = new FileInputStream(classFile);
+                    byte[] b = InputStreamToByteArray.convert(fis);
+                    fis.close();
                     Log.debug(this, "  loading " + name + " from " + classFile.getAbsolutePath());
                     return defineClass(b, 0, b.length);
                 } catch (Exception e) {
@@ -130,8 +132,10 @@ public class Loader extends Watcher {
                             if (ze != null) {
                                 byte[] b = InputStreamToByteArray.convert(zf.getInputStream(ze));
                                 Log.debug(this, "    loading " + name + " from " + f.getAbsolutePath());
+                                zf.close();
                                 return defineClass(b, 0, b.length);
                             }
+                            zf.close();
                         }
                     }
                 } catch (Exception e) {
@@ -150,8 +154,10 @@ public class Loader extends Watcher {
                             if (ze != null) {
                                 byte[] b = InputStreamToByteArray.convert(zf.getInputStream(ze));
                                 Log.debug(this, "    loading " + name + " from " + f.getAbsolutePath());
+                                zf.close();
                                 return defineClass(b, 0, b.length);
                             }
+                            zf.close();
                         }
                     }
                 } catch (Exception e) {