Commit 5f438224 authored by Hans Zandbelt's avatar Hans Zandbelt
Browse files

improve SSL leak fix redis/hiredis#896



Free SSL object when redisSSLConnect fails but avoid doing that for
callers of redisInitiateSSL who are supposed to manager their own SSL
object.
Signed-off-by: default avatarHans Zandbelt <hans.zandbelt@zmartzone.eu>
parent dfa33e60
......@@ -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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment