summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2021-09-08 07:37:37 -0700
committerKevin McCarthy <kevin@8t8.us>2021-09-08 14:36:59 -0700
commit57c1017d97ae26bac31be3a0b3cbfd4c1c2ddd60 (patch)
tree0df25206e881d0a453b11c8f36021ad942f0dd66
parent1c819fd62704f9a452678243c7786c1c89ed609b (diff)
Clean up more context fields on a QRESYNC reset.
Reset ctx->size. Clear all hash structures. Currently imap_expunge_mailbox() triggers a resort, which can populate some of these hashes. The next commit will change that, but it's better to make sure there are no remnants in any hashes to avoid memory corruption.
-rw-r--r--imap/message.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/imap/message.c b/imap/message.c
index e79d52df..e2f1ada8 100644
--- a/imap/message.c
+++ b/imap/message.c
@@ -782,6 +782,11 @@ fail:
hash_destroy (&idata->uid_hash, NULL);
+ hash_destroy (&ctx->subj_hash, NULL);
+ hash_destroy (&ctx->id_hash, NULL);
+ hash_destroy (&ctx->label_hash, NULL);
+ mutt_clear_threads (ctx);
+
for (i = 0; i < ctx->msgcount; i++)
{
if (ctx->hdrs[i] && ctx->hdrs[i]->data)
@@ -789,6 +794,7 @@ fail:
mutt_free_header (&ctx->hdrs[i]);
}
ctx->msgcount = 0;
+ ctx->size = 0;
mutt_hcache_delete (idata->hcache, "/MODSEQ", imap_hcache_keylen);
imap_hcache_clear_uid_seqset (idata);