From cfe1156eb724e6b83ea9bc779c2ecf11a046c0ca Mon Sep 17 00:00:00 2001 From: "Roger A. Light" Date: Thu, 8 Jan 2015 18:41:14 +0000 Subject: [PATCH] Reference count store structs when reloading from db. Without this increment, a message could be incorrectly freed in rare circumstances. --- src/persist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/persist.c b/src/persist.c index 30f78137..ed6f9950 100644 --- a/src/persist.c +++ b/src/persist.c @@ -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){