From 8a8436f73d4c4edd10b43313b724f32ccb7b957e Mon Sep 17 00:00:00 2001 From: Abhishek Koneru Date: Wed, 20 Jun 2012 13:56:57 -0400 Subject: Fixes for Coverity issues of type Resource Leaks - Remaining --- base/ca/src/com/netscape/ca/CertificateAuthority.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'base/ca') 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; } -- cgit