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

(cherry picked from commit f7af2ac)
Signed-off-by: Kezhu Wang <[email protected]>
  • Loading branch information
Gowrima authored and kezhuw committed Dec 7, 2024
1 parent 644dcdb commit 15423a4
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 15423a4

Please sign in to comment.