Reference count store structs when reloading from db.

Without this increment, a message could be incorrectly freed in rare
circumstances.
This commit is contained in:
Roger A. Light
2015-01-08 18:41:14 +00:00
parent b52e3311d2
commit cfe1156eb7
+1
View File
@@ -431,6 +431,7 @@ static int _db_client_msg_restore(struct mosquitto_db *db, const char *client_id
return 1;
}
cmsg->store = load->store;
cmsg->store->ref_count++;
context = _db_find_or_add_context(db, client_id, 0);
if(!context){