summaryrefslogtreecommitdiffstats
path: root/rpc
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2012-11-19 14:28:20 -0500
committerVijay Bellur <vbellur@redhat.com>2012-11-23 02:10:43 -0800
commit4a8f751b7c85b80ed3cbb5c1292200ebfaa49747 (patch)
tree0130e2b605466f470fac02265c230a38fcbb17ea /rpc
parentd5999c107a89dda38e8107ab8660130e052418b6 (diff)
socket: fix double-free when ssl_setup_connection fails
Change-Id: I893b166da28f4c21e582ed477399c4bc0c1d20e1 BUG: 877903 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4208 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'rpc')
-rw-r--r--rpc/rpc-transport/socket/src/socket.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c
index ff6983f..9761261 100644
--- a/rpc/rpc-transport/socket/src/socket.c
+++ b/rpc/rpc-transport/socket/src/socket.c
@@ -303,6 +303,7 @@ ssl_error:
ssl_dump_error_stack(this->name);
free_ssl:
SSL_free(priv->ssl_ssl);
+ priv->ssl_ssl = NULL;
done:
return ret;
}
@@ -495,7 +496,7 @@ __socket_disconnect (rpc_transport_t *this)
"shutdown() returned %d. %s",
ret, strerror (errno));
}
- if (priv->use_ssl) {
+ if (priv->ssl_ssl) {
SSL_shutdown(priv->ssl_ssl);
SSL_clear(priv->ssl_ssl);
SSL_free(priv->ssl_ssl);