Sentinel tls memory leak
There was a memory leak when tls is used in Sentinels.
The memory leak is noticed when some of the replicas are offline.
@@ -2348,7 +2348,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;
}
