From 4325c44baf1712b75eb6f2ece422f20a921acaec Mon Sep 17 00:00:00 2001 From: Matthias Stone Date: Wed, 12 Dec 2018 17:44:18 -0700 Subject: [PATCH] Don't clear SSL context when TLS connection is closed. Previous behaviour would clear the external SSL_CTX provided by MOSQ_OPT_SSL_CTX. This required the user to reset the SSL_CTX every disconnect, and trust that they were not leaking references. Recreating the SSL context for every connection is not necessary, and the SSL context is freed in mosquitto_destroy, which is sufficient. Signed-off-by: Matthias Stone --- lib/net_mosq.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/lib/net_mosq.c b/lib/net_mosq.c index 2473da4c..c7de615a 100644 --- a/lib/net_mosq.c +++ b/lib/net_mosq.c @@ -149,10 +149,6 @@ int net__socket_close(struct mosquitto *mosq) SSL_free(mosq->ssl); mosq->ssl = NULL; } - if(mosq->ssl_ctx){ - SSL_CTX_free(mosq->ssl_ctx); - mosq->ssl_ctx = NULL; - } } #endif