Fix memory leak when reconnecting with TLS errors.
Fix memory leak that occurred if mosquitto_reconnect() was used when TLS errors were present. Closes #592. Thanks to smartdabao and aaronovz1.
This commit is contained in:
parent
35dea07dcd
commit
0a9ee5b4cf
@ -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
|
||||
================
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user