/* free IMAP part of headers */
for (i = 0; i < ctx->msgcount; i++)
- imap_free_header_data (&(ctx->hdrs[i]->data));
+ /* mailbox may not have fully loaded */
+ if (ctx->hdrs[i]->data)
+ imap_free_header_data (&(ctx->hdrs[i]->data));
for (i = 0; i < IMAP_CACHE_LEN; i++)
{
else
/* bad header in the cache, we'll have to refetch.
* TODO: consider the possibility of a holey cache. */
- imap_free_header_data((void**) &h.data);
+ imap_free_header_data((void**) &h.data);
FREE(&uid_validity);
}
break;
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK)))
{
- imap_free_header_data ((void**) &h.data);
+ if (h.data)
+ imap_free_header_data ((void**) &h.data);
fclose (fp);
mutt_hcache_close (hc);
return -1;
if ((mfhrc < -1) || ((rc != IMAP_CMD_CONTINUE) && (rc != IMAP_CMD_OK)))
{
- imap_free_header_data ((void**) &h.data);
+ if (h.data)
+ imap_free_header_data ((void**) &h.data);
fclose (fp);
#if USE_HCACHE
mutt_hcache_close (hc);