mirror of
https://github.com/eclipse-mosquitto/mosquitto.git
synced 2026-09-23 08:33:48 +08:00
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:
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user