aboutsummaryrefslogtreecommitdiffstats
path: root/socket.c
diff options
context:
space:
mode:
Diffstat (limited to 'socket.c')
-rw-r--r--socket.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/socket.c b/socket.c
index e943f8b2..f0691b97 100644
--- a/socket.c
+++ b/socket.c
@@ -906,6 +906,8 @@ int SSLOpen(int sock, char *mycert, char *mykey, char *myproto, int certck, char
if (SSL_set_fd(_ssl_context[sock], sock) == 0
|| SSL_connect(_ssl_context[sock]) < 1) {
ERR_print_errors_fp(stderr);
+ SSL_free( _ssl_context[sock] );
+ _ssl_context[sock] = NULL;
SSL_CTX_free(_ctx[sock]);
_ctx[sock] = NULL;
return(-1);