This is an automated email from the ASF dual-hosted git repository.
symat 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 38f8e1b ZOOKEEPER-3944: Fix sasl memory leak
38f8e1b is described below
commit 38f8e1bff2502d57dd4541ddd5d7e8b4ac10bc02
Author: Xiaotian <[email protected]>
AuthorDate: Mon Sep 28 07:26:25 2020 +0000
ZOOKEEPER-3944: Fix sasl memory leak
Within ```zoo_sasl_client_destroy```, it carefully free all members of the
sasl client, while here it doesn't free the struct itself before set it to
NULL. This error is detected by leak sanitizer.
Author: Xiaotian <[email protected]>
Reviewers: Damien Diederen <[email protected]>, Enrico Olivelli
<[email protected]>, Mate Szalay-Beko <[email protected]>
Closes #1466 from xiaotian-qi/ZOOKEEPER-3944
---
zookeeper-client/zookeeper-client-c/src/zookeeper.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
index ec42e78..1728c0e 100644
--- a/zookeeper-client/zookeeper-client-c/src/zookeeper.c
+++ b/zookeeper-client/zookeeper-client-c/src/zookeeper.c
@@ -694,6 +694,7 @@ static void destroy(zhandle_t *zh)
#ifdef HAVE_CYRUS_SASL_H
if (zh->sasl_client) {
zoo_sasl_client_destroy(zh->sasl_client);
+ free(zh->sasl_client);
zh->sasl_client = NULL;
}
#endif /* HAVE_CYRUS_SASL_H */