Skip to content

Commit

Permalink
Fix memory leak from ssl cert in c client
Browse files Browse the repository at this point in the history
  • Loading branch information
Gowrima committed Oct 30, 2024
1 parent 6d71307 commit 264cec2
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions zookeeper-client/zookeeper-client-c/src/zookeeper.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ static void destroy(zhandle_t *zh)
#ifdef HAVE_OPENSSL_H
if (zh->fd->cert) {
free(zh->fd->cert->certstr);
free(zh->fd->cert->ca);
free(zh->fd->cert);
zh->fd->cert = NULL;
}
Expand Down Expand Up @@ -3873,8 +3874,6 @@ int zookeeper_close(zhandle_t *zh)
LOG_INFO(LOGCALLBACK(zh), "Freeing zookeeper resources for sessionId=%#llx\n", zh->client_id.client_id);
destroy(zh);
adaptor_destroy(zh);
free(zh->fd->cert->certstr);
free(zh->fd->cert->ca);
free(zh->fd);
free(zh);
#ifdef _WIN32
Expand Down

0 comments on commit 264cec2

Please sign in to comment.