hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dhr...@apache.org
Subject svn commit: r880632 - in /hadoop/common/branches/branch-0.20: CHANGES.txt src/c++/libhdfs/hdfs.c
Date Mon, 16 Nov 2009 06:55:43 GMT
Author: dhruba
Date: Mon Nov 16 06:55:39 2009
New Revision: 880632

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


Modified:
    hadoop/common/branches/branch-0.20/CHANGES.txt
    hadoop/common/branches/branch-0.20/src/c++/libhdfs/hdfs.c

Modified: hadoop/common/branches/branch-0.20/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/CHANGES.txt?rev=880632&r1=880631&r2=880632&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/CHANGES.txt (original)
+++ hadoop/common/branches/branch-0.20/CHANGES.txt Mon Nov 16 06:55:39 2009
@@ -63,6 +63,9 @@
     MAPREDUCE-1068. Fix streaming job to show proper message if file is 
     is not present. (Amareshwari Sriramadasu via sharad)
 
+    HDFS-596. Fix memory leak in hdfsFreeFileInfo() for libhdfs.
+    (Zhang Bingjun via dhruba)
+
 Release 0.20.1 - 2009-09-01
 
   INCOMPATIBLE CHANGES

Modified: hadoop/common/branches/branch-0.20/src/c++/libhdfs/hdfs.c
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20/src/c%2B%2B/libhdfs/hdfs.c?rev=880632&r1=880631&r2=880632&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20/src/c++/libhdfs/hdfs.c (original)
+++ hadoop/common/branches/branch-0.20/src/c++/libhdfs/hdfs.c Mon Nov 16 06:55:39 2009
@@ -2071,12 +2071,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