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/ca | |
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/ca')
-rw-r--r-- | base/ca/src/com/netscape/ca/CertificateAuthority.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/base/ca/src/com/netscape/ca/CertificateAuthority.java b/base/ca/src/com/netscape/ca/CertificateAuthority.java index 321fd9410..feecec6a8 100644 --- a/base/ca/src/com/netscape/ca/CertificateAuthority.java +++ b/base/ca/src/com/netscape/ca/CertificateAuthority.java @@ -1328,10 +1328,14 @@ public class CertificateAuthority implements ICertificateAuthority, ICertAuthori File file = new File(path); Long l = Long.valueOf(file.length()); byte[] b = new byte[l.intValue()]; - FileInputStream in = new FileInputStream(path); - in.read(b); - in.close(); - + FileInputStream in = null; + try { + in = new FileInputStream(path); + in.read(b); + } finally { + if (in != null) + in.close(); + } return b; } |