Skip to content

Commit f7af2ac

Browse files
authored
ZOOKEEPER-4020: Fix memory leak from ssl cert in c client
Reviewers: kezhuw Author: Gowrima Closes #2209 from Gowrima/ZOOKEEPER-4020
1 parent d1d57c4 commit f7af2ac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zookeeper-client/zookeeper-client-c/src/zookeeper.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -1454,7 +1454,7 @@ zhandle_t *zookeeper_init_ssl(const char *host, const char *cert, watcher_fn wat
14541454
{
14551455
zcert_t zcert;
14561456
zcert.certstr = strdup(cert);
1457-
zcert.ca = strtok(strdup(cert), ",");
1457+
zcert.ca = strtok(zcert.certstr, ",");
14581458
zcert.cert = strtok(NULL, ",");
14591459
zcert.key = strtok(NULL, ",");
14601460
zcert.passwd = strtok(NULL, ",");

0 commit comments

Comments
 (0)