ソースを参照

ZOOKEEPER-1562. Memory leaks in zoo_multi API (Deepak Jagtap via phunt)

git-svn-id: https://svn.apache.org/repos/asf/zookeeper/trunk@1441862 13f79535-47bb-0310-9956-ffa450edef68
Patrick D. Hunt 12 年 前
コミット
56591bf514
2 ファイル変更7 行追加0 行削除
  1. 3 0
      CHANGES.txt
  2. 4 0
      src/c/src/zookeeper.c

+ 3 - 0
CHANGES.txt

@@ -317,6 +317,9 @@ BUGFIXES:
   ZOOKEEPER-1613. The documentation still points to 2008 in the
   ZOOKEEPER-1613. The documentation still points to 2008 in the
   copyright notice (Edward Ribeiro via phunt)
   copyright notice (Edward Ribeiro via phunt)
 
 
+  ZOOKEEPER-1562. Memory leaks in zoo_multi API
+  (Deepak Jagtap via phunt)
+
 IMPROVEMENTS:
 IMPROVEMENTS:
 
 
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,
   ZOOKEEPER-1170. Fix compiler (eclipse) warnings: unused imports,

+ 4 - 0
src/c/src/zookeeper.c

@@ -2364,6 +2364,10 @@ static int deserialize_multi(int xid, completion_list_t *cptr, struct iarchive *
 
 
         deserialize_response(entry->c.type, xid, mhdr.type == -1, mhdr.err, entry, ia);
         deserialize_response(entry->c.type, xid, mhdr.type == -1, mhdr.err, entry, ia);
         deserialize_MultiHeader(ia, "multiheader", &mhdr);
         deserialize_MultiHeader(ia, "multiheader", &mhdr);
+        //While deserializing the response we must destroy completion entry for each operation in 
+        //the zoo_multi transaction. Otherwise this results in memory leak when client invokes zoo_multi
+        //operation.
+        destroy_completion_entry(entry);
     }
     }
 
 
     return rc;
     return rc;