directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From plusplusjia...@apache.org
Subject [06/10] directory-kerby git commit: DIRKRB-403 Resource leaks in IOUtil and ToolUtil. Contributed by Gerard Gagliano.
Date Thu, 20 Aug 2015 02:38:15 GMT
DIRKRB-403 Resource leaks in IOUtil and ToolUtil. Contributed by Gerard Gagliano.


Project: http://git-wip-us.apache.org/repos/asf/directory-kerby/repo
Commit: http://git-wip-us.apache.org/repos/asf/directory-kerby/commit/bf0205e1
Tree: http://git-wip-us.apache.org/repos/asf/directory-kerby/tree/bf0205e1
Diff: http://git-wip-us.apache.org/repos/asf/directory-kerby/diff/bf0205e1

Branch: refs/heads/pkinit-support
Commit: bf0205e177297c727ca26e323de4836dd7cca8ae
Parents: 67df19a
Author: plusplusjiajia <jiajia.li@intel.com>
Authored: Fri Aug 14 15:30:15 2015 +0800
Committer: plusplusjiajia <jiajia.li@intel.com>
Committed: Fri Aug 14 15:30:15 2015 +0800

----------------------------------------------------------------------
 .../java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java     | 4 +++-
 kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java       | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bf0205e1/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java
----------------------------------------------------------------------
diff --git a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java
b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java
index 943fdfc..873b4c9 100644
--- a/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java
+++ b/kerby-tool/kdc-tool/src/main/java/org/apache/kerby/kerberos/tool/kadmin/ToolUtil.java
@@ -79,6 +79,8 @@ public class ToolUtil {
     public static String getReplay(String prompt) {
         Scanner scanner = new Scanner(System.in, "UTF-8");
         System.out.println(prompt);
-        return scanner.nextLine().trim();
+        String str = scanner.nextLine().trim();
+        scanner.close();
+        return str;
     }
 }

http://git-wip-us.apache.org/repos/asf/directory-kerby/blob/bf0205e1/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
----------------------------------------------------------------------
diff --git a/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java b/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
index 3e52932..f3760b5 100644
--- a/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
+++ b/kerby-util/src/main/java/org/apache/kerby/util/IOUtil.java
@@ -102,5 +102,6 @@ public final class IOUtil {
 
         ByteBuffer buffer = ByteBuffer.wrap(Utf8.toBytes(content));
         fc.write(buffer);
+        outputStream.close();
     }
 }


Mime
View raw message