Assign to NULL to prevent double free later.

This commit is contained in:
Roger A. Light 2014-10-21 23:11:31 +01:00
parent 7a2dd634cb
commit 66443c14bd

View file

@ -201,6 +201,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context)
goto handle_connect_error;
}else{ /* mqtt311 */
_mosquitto_free(client_id);
client_id = NULL;
if(clean_session == 0 || db->config->allow_zero_length_clientid == false){
_mosquitto_send_connack(context, 0, CONNACK_REFUSED_IDENTIFIER_REJECTED);