diff options
author | Abhishek Koneru <akoneru@redhat.com> | 2012-06-20 13:56:57 -0400 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2012-06-25 13:38:26 -0500 |
commit | 8a8436f73d4c4edd10b43313b724f32ccb7b957e (patch) | |
tree | 657c8f9accd34d286acf0569f768c72684a12b75 /base/util/src/netscape/security/x509/OIDMap.java | |
parent | de3aaef15e9b1f192344019f52d6c80860055b5e (diff) | |
download | pki-8a8436f73d4c4edd10b43313b724f32ccb7b957e.tar.gz pki-8a8436f73d4c4edd10b43313b724f32ccb7b957e.tar.xz pki-8a8436f73d4c4edd10b43313b724f32ccb7b957e.zip |
Fixes for Coverity issues of type Resource Leaks - Remaining
Diffstat (limited to 'base/util/src/netscape/security/x509/OIDMap.java')
-rw-r--r-- | base/util/src/netscape/security/x509/OIDMap.java | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/base/util/src/netscape/security/x509/OIDMap.java b/base/util/src/netscape/security/x509/OIDMap.java index 17573a019..4cebcf2c8 100644 --- a/base/util/src/netscape/security/x509/OIDMap.java +++ b/base/util/src/netscape/security/x509/OIDMap.java @@ -165,12 +165,20 @@ public class OIDMap { if (!namesMap.exists()) { loadNamesDefault(props); } else { + FileInputStream fis = null; try { - FileInputStream fis = new FileInputStream(namesMap); + fis = new FileInputStream(namesMap); props.load(fis); - fis.close(); } catch (IOException e) { loadNamesDefault(props); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } } @@ -193,11 +201,20 @@ public class OIDMap { if (!classMap.exists()) { loadClassDefault(props); } else { + FileInputStream fis = null; try { - FileInputStream fis = new FileInputStream(classMap); + fis = new FileInputStream(classMap); props.load(fis); } catch (IOException e) { loadClassDefault(props); + } finally { + if (fis != null) { + try { + fis.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } } } |