commit d4005f12d64767d6df98b6c6752f61d723cc6777
parent a1d8f05f4e1a40f16a6fa2ed23ab5a0e75987230
Author: Colin Leroy <colin@colino.net>
Date: Mon, 17 Nov 2014 09:24:58 +0100
Fix use after free
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/msgcache.c b/src/msgcache.c
@@ -187,10 +187,12 @@ void msgcache_remove_msg(MsgCache *cache, guint msgnum)
if(msginfo->msgid)
g_hash_table_remove(cache->msgid_table, msginfo->msgid);
g_hash_table_remove(cache->msgnum_table, &msginfo->msgnum);
+
+ msginfo->folder->cache_dirty = TRUE;
+
procmsg_msginfo_free(msginfo);
cache->last_access = time(NULL);
- msginfo->folder->cache_dirty = TRUE;
debug_print("Cache size: %d messages, %u bytes\n", g_hash_table_size(cache->msgnum_table), cache->memusage);
}