summaryrefslogtreecommitdiff
path: root/ssl.c
diff options
context:
space:
mode:
authorMichael Grunder <michael.grunder@gmail.com>2021-05-02 11:49:48 -0700
committerGitHub <noreply@github.com>2021-05-02 11:49:48 -0700
commit9bf6c250e5e0ed7e68377f2986877959aaa95920 (patch)
tree70b62a28d3b5bd2fdab3a11870779ffc57499904 /ssl.c
parent959af9760972460017442697a127e55b4e70a39b (diff)
parent5f4382247a0074d2080921956cd9784bbd1824c2 (diff)
Merge pull request #939 from zmartzone/improve_pr_896_ssl_leak
improve SSL leak fix redis/hiredis#896
Diffstat (limited to 'ssl.c')
-rw-r--r--ssl.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ssl.c b/ssl.c
index c856bbc..c581f63 100644
--- a/ssl.c
+++ b/ssl.c
@@ -351,7 +351,6 @@ static int redisSSLConnect(redisContext *c, SSL *ssl) {
}
hi_free(rssl);
- SSL_free(ssl);
return REDIS_ERR;
}
@@ -393,7 +392,11 @@ int redisInitiateSSLWithContext(redisContext *c, redisSSLContext *redis_ssl_ctx)
}
}
- return redisSSLConnect(c, ssl);
+ if (redisSSLConnect(c, ssl) != REDIS_OK) {
+ goto error;
+ }
+
+ return REDIS_OK;
error:
if (ssl)