diff --git a/ChangeLog.txt b/ChangeLog.txt index 18c5514d..50f02d9c 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,11 @@ +1.5.4 - 201810xx +================ + +Library: +- Fix memory leak that occurred if mosquitto_reconnect() was used when TLS +errors were present. Closes #592. + + 1.5.3 - 20180925 ================ diff --git a/lib/net_mosq.c b/lib/net_mosq.c index 5494abae..4efda3d2 100644 --- a/lib/net_mosq.c +++ b/lib/net_mosq.c @@ -596,6 +596,9 @@ int net__socket_connect_step3(struct mosquitto *mosq, const char *host, uint16_t if(rc) return rc; if(mosq->ssl_ctx){ + if(mosq->ssl){ + SSL_free(mosq->ssl); + } mosq->ssl = SSL_new(mosq->ssl_ctx); if(!mosq->ssl){ COMPAT_CLOSE(mosq->sock);