Author: nextgens
Date: 2008-02-26 08:34:18 +0000 (Tue, 26 Feb 2008)
New Revision: 18163
Modified:
trunk/freenet/src/freenet/crypt/SSL.java
Log:
SSL: don't leave the FD to the GC if an exception is thrown
Modified: trunk/freenet/src/freenet/crypt/SSL.java
===================================================================
--- trunk/freenet/src/freenet/crypt/SSL.java 2008-02-26 08:32:02 UTC (rev
18162)
+++ trunk/freenet/src/freenet/crypt/SSL.java 2008-02-26 08:34:18 UTC (rev
18163)
@@ -242,9 +242,13 @@
private static void storeKeyStore() throws Exception {
if(enable) {
- FileOutputStream fos = new FileOutputStream(keyStore);
- keystore.store(fos, keyStorePass.toCharArray());
- fos.close();
+ FileOutputStream fos = null;
+ try {
+ fos = new FileOutputStream(keyStore);
+ keystore.store(fos, keyStorePass.toCharArray());
+ } finally {
+ Closer.close(fos);
+ }
}
}