This is an automated email from the ASF dual-hosted git repository.
kezhuw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/zookeeper.git
The following commit(s) were added to refs/heads/master by this push:
new f7af2acd7 ZOOKEEPER-4020: Fix memory leak from ssl cert in c client
f7af2acd7 is described below
commit f7af2acd7f92868507e66780bf6818f47d068a77
Author: Gowrima <[email protected]>
AuthorDate: Fri Dec 6 21:58:18 2024 -0800
ZOOKEEPER-4020: Fix memory leak from ssl cert in c client
Reviewers: kezhuw
Author: Gowrima
Closes #2209 from Gowrima/ZOOKEEPER-4020
---
zookeeper-client/zookeeper-client-c/src/zookeeper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index 84a2245b2..972215bf0 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -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, ",");