summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorMohit Agrawal <moagrawal@redhat.com>2020-04-23 11:49:32 +0530
committerMOHIT AGRAWAL <moagrawa@redhat.com>2020-04-28 14:19:36 +0000
commit9873baee34afdf0c20f5fc98a7dbf2a9f07447e2 (patch)
tree9074742aeb72ffd17cba2a809c51472f97e45944 /rpc
parent37d6c03902c71fec611a70e52e92a2dc36a26706 (diff)
socket: Resolve ssl_ctx leak for a brick while only mgmt SSL is enabled
Problem: While only mgmt SSL is enabled for a brick process use_ssl flag is false for a brick process and socket api's cleanup ssl_ctx only while use_ssl and ssl_ctx both are valid Solution: To avoid a leak check only ssl_ctx, if it is valid cleanup ssl_ctx Fixes: #1196 Change-Id: I2f4295478f4149dcb7d608ea78ee5104f28812c3 Signed-off-by: Mohit Agrawal <moagrawal@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index 17002d4..ddaa108 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -1154,7 +1154,7 @@ __socket_reset(rpc_transport_t *this)
SSL_free(priv->ssl_ssl);
priv->ssl_ssl = NULL;
}
- if (priv->use_ssl && priv->ssl_ctx) {
+ if (priv->ssl_ctx) {
SSL_CTX_free(priv->ssl_ctx);
priv->ssl_ctx = NULL;
}
@@ -4608,7 +4608,7 @@ fini(rpc_transport_t *this)
SSL_free(priv->ssl_ssl);
priv->ssl_ssl = NULL;
}
- if (priv->use_ssl && priv->ssl_ctx) {
+ if (priv->ssl_ctx) {
SSL_CTX_free(priv->ssl_ctx);
priv->ssl_ctx = NULL;
}