Skip to content

Commit

Permalink
ZOOKEEPER-4020: Fix memory leak from ssl cert in c client
Browse files Browse the repository at this point in the history
Reviewers: kezhuw
Author: Gowrima
Closes #2209 from Gowrima/ZOOKEEPER-4020
  • Loading branch information
Gowrima authored Dec 7, 2024
1 parent d1d57c4 commit f7af2ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zookeeper-client/zookeeper-client-c/src/zookeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ zhandle_t *zookeeper_init_ssl(const char *host, const char *cert, watcher_fn wat
{
zcert_t zcert;
zcert.certstr = strdup(cert);
zcert.ca = strtok(strdup(cert), ",");
zcert.ca = strtok(zcert.certstr, ",");
zcert.cert = strtok(NULL, ",");
zcert.key = strtok(NULL, ",");
zcert.passwd = strtok(NULL, ",");
Expand Down

0 comments on commit f7af2ac

Please sign in to comment.