From f52c756fbbf88459ebfa0f89481aaf472e86040a Mon Sep 17 00:00:00 2001 From: Sergey Lyubka <valenok@gmail.com> Date: Wed, 16 Apr 2014 16:45:31 +0100 Subject: [PATCH] Calling SSL_free() in ns_close_conn() --- mongoose.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mongoose.c b/mongoose.c index cfb6e34f9..9e963610b 100644 --- a/mongoose.c +++ b/mongoose.c @@ -418,6 +418,11 @@ static void ns_close_conn(struct ns_connection *conn) { closesocket(conn->sock); iobuf_free(&conn->recv_iobuf); iobuf_free(&conn->send_iobuf); +#ifdef NS_ENABLE_SSL + if (conn->ssl != NULL) { + SSL_free(conn->ssl); + } +#endif NS_FREE(conn); } @@ -985,6 +990,7 @@ void ns_server_free(struct ns_server *s) { #ifdef NS_ENABLE_SSL if (s->ssl_ctx != NULL) SSL_CTX_free(s->ssl_ctx); if (s->client_ssl_ctx != NULL) SSL_CTX_free(s->client_ssl_ctx); + s->ssl_ctx = s->client_ssl_ctx = NULL; #endif } -- GitLab