Protect against possible NULL dereference after unsubscribing.

pull/211/merge
Roger A. Light 11 years ago
parent 6e0fd9e3ec
commit 7a2dd634cb

@ -441,6 +441,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context)
found_context->sub_count = 0;
for(i=0; i<context->sub_count; i++){
if(context->subs[i]){
leaf = context->subs[i]->subs;
while(leaf){
if(leaf->context == found_context){
@ -450,6 +451,7 @@ int mqtt3_handle_connect(struct mosquitto_db *db, struct mosquitto *context)
}
}
}
}
found_context->clean_session = true;
found_context->state = mosq_cs_disconnecting;

Loading…
Cancel
Save