zookeeper-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maha...@apache.org
Subject svn commit: r1212172 - in /zookeeper/trunk: CHANGES.txt src/c/src/zookeeper.c
Date Thu, 08 Dec 2011 22:26:34 GMT
Author: mahadev
Date: Thu Dec  8 22:26:33 2011
New Revision: 1212172

URL: http://svn.apache.org/viewvc?rev=1212172&view=rev
Log:
ZOOKEEPER-1316. zookeeper_init leaks memory if chroot is just \'/\'. (Akira Kitada via mahadev)

Modified:
    zookeeper/trunk/CHANGES.txt
    zookeeper/trunk/src/c/src/zookeeper.c

Modified: zookeeper/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/zookeeper/trunk/CHANGES.txt?rev=1212172&r1=1212171&r2=1212172&view=diff
==============================================================================
--- zookeeper/trunk/CHANGES.txt (original)
+++ zookeeper/trunk/CHANGES.txt Thu Dec  8 22:26:33 2011
@@ -65,6 +65,9 @@ BUGFIXES:
 
   ZOOKEEPER-1262. Documentation for Lock recipe has major flaw.
   (Jordan Zimmerman via mahadev)
+
+  ZOOKEEPER-1316. zookeeper_init leaks memory if chroot is just '/'.
+  (Akira Kitada via mahadev)
  
 IMPROVEMENTS:
 

Modified: zookeeper/trunk/src/c/src/zookeeper.c
URL: http://svn.apache.org/viewvc/zookeeper/trunk/src/c/src/zookeeper.c?rev=1212172&r1=1212171&r2=1212172&view=diff
==============================================================================
--- zookeeper/trunk/src/c/src/zookeeper.c (original)
+++ zookeeper/trunk/src/c/src/zookeeper.c Thu Dec  8 22:26:33 2011
@@ -804,6 +804,7 @@ zhandle_t *zookeeper_init(const char *ho
         zh->chroot = strdup(index_chroot);
         // if chroot is just / set it to null
         if (strlen(zh->chroot) == 1) {
+            free(zh->chroot);
             zh->chroot = NULL;
         }
         // cannot use strndup so allocate and strcpy



Mime
View raw message