hi all ,

I am new in this mailing-list -

and i joined  because i think a find a bug ,  and i want to know what  is 
procedure for fixing it.


the bug is in the c binding - when you use  "zoo_remove_watchers" ,

and it's can cause to someone that use this function to delete other watch - 
and not the one he mean to delete.


The actual problem is in the function "removeWatcherFromList" -

That when we check if we need to delete the watch -  we compare the WatcherCtx 
to one node before the one we want to delete..


a suggested patch is attached ..


thanks a lot,

eyal

diff --git a/src/c/src/zk_hashtable.c b/src/c/src/zk_hashtable.c
index 8f87a96..da3fb83 100644
--- a/src/c/src/zk_hashtable.c
+++ b/src/c/src/zk_hashtable.c
@@ -371,7 +371,7 @@ static void removeWatcherFromList(watcher_object_list_t *wl, watcher_fn watcher,
     while (e){
         if (e->next &&
             e->next->watcher == watcher &&
-            e->context == watcherCtx) {
+            e->next->context == watcherCtx) {
             watcher_object_t *this = e->next;
             e->next = e->next->next;
             free(this);

Reply via email to