Author: mahadev
Date: Thu Oct 28 18:50:24 2010
New Revision: 1028429

URL: http://svn.apache.org/viewvc?rev=1028429&view=rev
Log:
ZOOKEEPER-898. C Client might not cleanup correctly during close (jared 
cantwell via mahadev)

Modified:
    hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
    hadoop/zookeeper/branches/branch-3.3/src/c/src/zookeeper.c

Modified: hadoop/zookeeper/branches/branch-3.3/CHANGES.txt
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/CHANGES.txt?rev=1028429&r1=1028428&r2=1028429&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/CHANGES.txt (original)
+++ hadoop/zookeeper/branches/branch-3.3/CHANGES.txt Thu Oct 28 18:50:24 2010
@@ -61,6 +61,9 @@ BUGFIXES:
 
   ZOOKEEPER-897. C Client seg faults during close (jared cantwell via mahadev)
 
+  ZOOKEEPER-898. C Client might not cleanup correctly during close 
+  (jared cantwell via mahadev)
+
 IMPROVEMENTS:
 
   ZOOKEEPER-789. Improve FLE log messages (flavio via phunt)

Modified: hadoop/zookeeper/branches/branch-3.3/src/c/src/zookeeper.c
URL: 
http://svn.apache.org/viewvc/hadoop/zookeeper/branches/branch-3.3/src/c/src/zookeeper.c?rev=1028429&r1=1028428&r2=1028429&view=diff
==============================================================================
--- hadoop/zookeeper/branches/branch-3.3/src/c/src/zookeeper.c (original)
+++ hadoop/zookeeper/branches/branch-3.3/src/c/src/zookeeper.c Thu Oct 28 
18:50:24 2010
@@ -2227,14 +2227,15 @@ static int add_completion(zhandle_t *zh,
     lock_completion_list(&zh->sent_requests);
     if (zh->close_requested != 1) {
         queue_completion_nolock(&zh->sent_requests, c, add_to_front);
+        if (dc == SYNCHRONOUS_MARKER) {
+            zh->outstanding_sync++;
+        }
         rc = ZOK;
     } else {
+        free(c);
         rc = ZINVALIDSTATE;
     }
     unlock_completion_list(&zh->sent_requests);
-    if (dc == SYNCHRONOUS_MARKER) {
-        zh->outstanding_sync++;
-    }
     return rc;
 }
 


Reply via email to