kezhuw commented on code in PR #2209: URL: https://github.com/apache/zookeeper/pull/2209#discussion_r1821706486
########## zookeeper-client/zookeeper-client-c/src/zookeeper.c: ########## @@ -1324,6 +1324,8 @@ static zhandle_t *zookeeper_init_internal(const char *host, watcher_fn watcher, if (cert) { zh->fd->cert = calloc(1, sizeof(zcert_t)); memcpy(zh->fd->cert, cert, sizeof(zcert_t)); + free(cert->certstr); Review Comment: The two statements above copies `cert` from stack to heap. `cert`'s content must still be valid. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org