hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r880630 - in /hadoop/hdfs/trunk: CHANGES.txt src/c++/libhdfs/hdfs.c
Date Mon, 16 Nov 2009 06:55:18 GMT
Author: dhruba
Date: Mon Nov 16 06:55:13 2009
New Revision: 880630

URL: http://svn.apache.org/viewvc?rev=880630&view=rev
Log:
HDFS-596. Fix memory leak in hdfsFreeFileInfo() for libhdfs.
(Zhang Bingjun via dhruba)


Modified:
    hadoop/hdfs/trunk/CHANGES.txt
    hadoop/hdfs/trunk/src/c++/libhdfs/hdfs.c

Modified: hadoop/hdfs/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/CHANGES.txt?rev=880630&r1=880629&r2=880630&view=diff
==============================================================================
--- hadoop/hdfs/trunk/CHANGES.txt (original)
+++ hadoop/hdfs/trunk/CHANGES.txt Mon Nov 16 06:55:13 2009
@@ -531,6 +531,9 @@
 
     HDFS-723. Fix deadlock in DFSClient#DFSOutputStream. (hairong)
 
+    HDFS-596. Fix memory leak in hdfsFreeFileInfo() for libhdfs.
+    (Zhang Bingjun via dhruba)
+
 Release 0.20.1 - 2009-09-01
 
   IMPROVEMENTS

Modified: hadoop/hdfs/trunk/src/c++/libhdfs/hdfs.c
URL: http://svn.apache.org/viewvc/hadoop/hdfs/trunk/src/c%2B%2B/libhdfs/hdfs.c?rev=880630&r1=880629&r2=880630&view=diff
==============================================================================
--- hadoop/hdfs/trunk/src/c++/libhdfs/hdfs.c (original)
+++ hadoop/hdfs/trunk/src/c++/libhdfs/hdfs.c Mon Nov 16 06:55:13 2009
@@ -2260,12 +2260,18 @@
 
 void hdfsFreeFileInfo(hdfsFileInfo *hdfsFileInfo, int numEntries)
 {
-    //Free the mName
+    //Free the mName, mOwner, and mGroup
     int i;
     for (i=0; i < numEntries; ++i) {
         if (hdfsFileInfo[i].mName) {
             free(hdfsFileInfo[i].mName);
         }
+        if (hdfsFileInfo[i].mOwner) {
+            free(hdfsFileInfo[i].mOwner);
+        }
+        if (hdfsFileInfo[i].mGroup) {
+            free(hdfsFileInfo[i].mGroup);
+        }
     }
 
     //Free entire block



Mime
View raw message