hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ecl...@apache.org
Subject svn commit: r1545877 - /hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java
Date Tue, 26 Nov 2013 22:34:06 GMT
Author: eclark
Date: Tue Nov 26 22:34:05 2013
New Revision: 1545877

URL: http://svn.apache.org/r1545877
Log:
HBASE-10038 Fix potential Resource Leak in ZNodeCleaner

Modified:
    hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java

Modified: hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java?rev=1545877&r1=1545876&r2=1545877&view=diff
==============================================================================
--- hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java
(original)
+++ hbase/branches/0.96/hbase-server/src/main/java/org/apache/hadoop/hbase/ZNodeClearer.java
Tue Nov 26 22:34:05 2013
@@ -94,10 +94,14 @@ public class ZNodeClearer {
       throw new FileNotFoundException("No filename; set environment variable HBASE_ZNODE_FILE");
     }
     FileReader znodeFile = new FileReader(fileName);
-    BufferedReader br = new BufferedReader(znodeFile);
-    String file_content = br.readLine();
-    br.close();
-    return file_content;
+    BufferedReader br = null;
+    try {
+      br = new BufferedReader(znodeFile);
+      String file_content = br.readLine();
+      return file_content;
+    } finally {
+      if (br != null) br.close();
+    }
   }
 
   /**



Mime
View raw message