summaryrefslogtreecommitdiffstats
path: root/base/java-tools
diff options
context:
space:
mode:
authorAbhishek Koneru <akoneru@redhat.com>2012-06-26 15:37:15 -0400
committerEndi Sukma Dewata <edewata@redhat.com>2012-07-02 12:44:05 -0500
commit0f3451befbc14bd6ec29d9e1e3845f970f288653 (patch)
tree346822835936131b9dc6c5fd8692ce9c60eeda03 /base/java-tools
parent10502e34a10fb3b672aef1161cc271003c7806ba (diff)
downloadpki-0f3451befbc14bd6ec29d9e1e3845f970f288653.tar.gz
pki-0f3451befbc14bd6ec29d9e1e3845f970f288653.tar.xz
pki-0f3451befbc14bd6ec29d9e1e3845f970f288653.zip
LeftOver Cases in Resource Leaks and NULL_RETURNS
Diffstat (limited to 'base/java-tools')
-rw-r--r--base/java-tools/src/com/netscape/cmstools/PKCS12Export.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java b/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
index df19bd9fe..9ab2f8505 100644
--- a/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
+++ b/base/java-tools/src/com/netscape/cmstools/PKCS12Export.java
@@ -221,8 +221,9 @@ public class PKCS12Export {
// get password
String pwd = null;
+ BufferedReader in = null;
try {
- BufferedReader in = new BufferedReader(new FileReader(pwdfile));
+ in = new BufferedReader(new FileReader(pwdfile));
pwd = in.readLine();
if (pwd == null) {
pwd = "";
@@ -230,10 +231,17 @@ public class PKCS12Export {
} catch (Exception e) {
debug("Failed to read the keydb password from the file. Exception: " + e.toString());
System.exit(1);
+ } finally {
+ if (in != null) {
+ try {
+ in.close();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ }
}
-
String pk12pwd = null;
- BufferedReader in = null;
+
try {
in = new BufferedReader(new FileReader(pk12pwdfile));
pk12pwd = in.readLine();