diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c b/zookeeper-client/zookeeper-client-c/src/zookeeper.c index 919e91006b9..802aa07a0b4 100644 --- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c +++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c @@ -1324,8 +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); - free(cert.ca); + free(cert->certstr); + free(cert->ca); } #ifdef _WIN32