Ver Fonte

ZOOKEEPER-2890: Local automatic variable is left uninitialized and then freed.

Fixes https://issues.apache.org/jira/browse/ZOOKEEPER-2890

Author: xoiss <xoiss@ubuntu>

Reviewers: Patrick Hunt <phunt@apache.org>

Closes #359 from xoiss/branch-3.4-bugfix-zookeeper-2890

Change-Id: Ib3d132fc812a62b720967a888aff28edb7f3bdf1
(cherry picked from commit 948766de31eb955d62e661b7c55b74aa64434c77)
Signed-off-by: Patrick Hunt <phunt@apache.org>
xoiss há 7 anos atrás
pai
commit
43a50ebc65
1 ficheiros alterados com 1 adições e 0 exclusões
  1. 1 0
      src/c/src/zookeeper.c

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

@@ -2675,6 +2675,7 @@ static void deserialize_response(zhandle_t *zh, int type, int xid, int failed, i
             cptr->c.string_result(rc, 0, cptr->data);
         } else {
             struct CreateResponse res;
+            memset(&res, 0, sizeof(res));
             deserialize_CreateResponse(ia, "reply", &res);
             cptr->c.string_result(rc, res.path, cptr->data);
             deallocate_CreateResponse(&res);