Only remove context from hash if there is a client id.

This should never happen, but just in case.
pull/1029/head
Roger A. Light 7 years ago
parent 7f1419e4de
commit 93f9e965a8

@ -638,9 +638,11 @@ void do_disconnect(struct mosquitto_db *db, struct mosquitto *context)
context->sock = INVALID_SOCKET;
context->pollfd_index = -1;
}
HASH_DELETE(hh_id, db->contexts_by_id, context);
context->old_id = context->id;
context->id = NULL;
if(context->id){
HASH_DELETE(hh_id, db->contexts_by_id, context);
context->old_id = context->id;
context->id = NULL;
}
}else
#endif
{

Loading…
Cancel
Save