[490] Fix auth plugin+WS client+MOSQ_ERR_AUTH related crash.

Thanks to "hasunperera".

Bug: https://github.com/eclipse/mosquitto/issues/490
pull/508/head
Roger A. Light 8 years ago
parent 7943072b1f
commit 22063013be

@ -4,6 +4,8 @@ Broker:
- Fix memory leak if a client provided a username/password for a listener with
use_identity_as_username configured.
- Fix use_identity_as_username not working on websockets clients.
- Don't crash if an auth plugin returns MOSQ_ERR_AUTH for a username check on
a websockets client. Closes #490.
Client library:
- Fix incorrect PSK key being used if it had leading zeroes.

@ -214,6 +214,10 @@ int _mosquitto_socket_close(struct mosquitto *mosq)
assert(mosq);
#ifdef WITH_TLS
#ifdef WITH_WEBSOCKETS
if(!mosq->wsi)
#endif
{
if(mosq->ssl){
SSL_shutdown(mosq->ssl);
SSL_free(mosq->ssl);
@ -223,6 +227,7 @@ int _mosquitto_socket_close(struct mosquitto *mosq)
SSL_CTX_free(mosq->ssl_ctx);
mosq->ssl_ctx = NULL;
}
}
#endif
if((int)mosq->sock >= 0){

Loading…
Cancel
Save