summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWen Hui <wen.hui.ware@gmail.com>2021-11-08 15:23:31 -0500
committerOran Agra <oran@redislabs.com>2022-04-27 16:31:52 +0300
commit94013b8ecb2e31df8a6d34e04975785b0008aa37 (patch)
tree1e34742bf18e2e0fb79fc326569d24a3e2c24e40
parent968cd2b967ac2e331afc25a1570aa2cecab8f38a (diff)
downloadredis-94013b8ecb2e31df8a6d34e04975785b0008aa37.tar.gz
Sentinel tls memory leak (#9753)
There was a memory leak when tls is used in Sentinels. The memory leak is noticed when some of the replicas are offline. (cherry picked from commit 2ce29e032b6d474c4e819597e1fb690e29e735d6)
-rw-r--r--src/sentinel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sentinel.c b/src/sentinel.c
index 2c91eafd2..5b1085487 100644
--- a/src/sentinel.c
+++ b/src/sentinel.c
@@ -2402,7 +2402,10 @@ static int instanceLinkNegotiateTLS(redisAsyncContext *context) {
SSL *ssl = SSL_new(redis_tls_client_ctx ? redis_tls_client_ctx : redis_tls_ctx);
if (!ssl) return C_ERR;
- if (redisInitiateSSL(&context->c, ssl) == REDIS_ERR) return C_ERR;
+ if (redisInitiateSSL(&context->c, ssl) == REDIS_ERR) {
+ SSL_free(ssl);
+ return C_ERR;
+ }
#endif
return C_OK;
}