diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index e8c7e5cc45..6c348091c9 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -511,6 +511,9 @@ Release 2.4.0 - UNRELEASED HADOOP-10214. Fix multithreaded correctness warnings in ActiveStandbyElector (Liang Xie via kasha) + HADOOP-10223. MiniKdc#main() should close the FileReader it creates. + (Ted Yu via tucu) + Release 2.3.0 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java b/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java index ed2142b46c..8eb24e9fc3 100644 --- a/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java +++ b/hadoop-common-project/hadoop-minikdc/src/main/java/org/apache/hadoop/minikdc/MiniKdc.java @@ -125,7 +125,15 @@ public static void main(String[] args) throws Exception { + file.getAbsolutePath()); } Properties userConf = new Properties(); - userConf.load(new FileReader(file)); + FileReader r = null; + try { + r = new FileReader(file); + userConf.load(r); + } finally { + if (r != null) { + r.close(); + } + } for (Map.Entry entry : userConf.entrySet()) { conf.put(entry.getKey(), entry.getValue()); }