]> granicus.if.org Git - neomutt/commitdiff
Don't clean up msn idata when closing an open-append mailbox. (see #3942)
authorKevin McCarthy <kevin@8t8.us>
Tue, 23 May 2017 01:30:38 +0000 (18:30 -0700)
committerKevin McCarthy <kevin@8t8.us>
Tue, 23 May 2017 01:30:38 +0000 (18:30 -0700)
This is a continuation of commit 59a2125b49f2 with changes made in the
default branch.

Thanks again to Will Yardley for helping test the imap read-headers
changes and discovering this bug.

imap/imap.c

index 67b2c4ce3491573278f84c69915578399bfa8e1b..a3b9e1e525e17bf96d994cedce2ffb9fcdabe8e2 100644 (file)
@@ -1409,6 +1409,9 @@ int imap_close_mailbox (CONTEXT* ctx)
     idata->ctx = NULL;
 
     hash_destroy (&idata->uid_hash, NULL);
+    FREE (&idata->msn_index);
+    idata->msn_index_size = 0;
+    idata->max_msn = 0;
 
     for (i = 0; i < IMAP_CACHE_LEN; i++)
     {
@@ -1427,8 +1430,6 @@ int imap_close_mailbox (CONTEXT* ctx)
     /* mailbox may not have fully loaded */
     if (ctx->hdrs[i] && ctx->hdrs[i]->data)
       imap_free_header_data ((IMAP_HEADER_DATA**)&(ctx->hdrs[i]->data));
-  FREE (&idata->msn_index);
-  idata->msn_index_size = 0;
 
   return 0;
 }