Don't call SSL_shutdown() if SSL init hasn't completed.

This commit is contained in:
Roger A. Light 2020-02-04 17:11:11 +00:00
parent 07c54627e9
commit 3a89059271

View File

@ -199,7 +199,9 @@ int net__socket_close(struct mosquitto *mosq)
#endif #endif
{ {
if(mosq->ssl){ if(mosq->ssl){
if(!SSL_in_init(mosq->ssl)){
SSL_shutdown(mosq->ssl); SSL_shutdown(mosq->ssl);
}
SSL_free(mosq->ssl); SSL_free(mosq->ssl);
mosq->ssl = NULL; mosq->ssl = NULL;
} }