diff options
Diffstat (limited to 'mailinfo.c')
-rw-r--r-- | mailinfo.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/mailinfo.c b/mailinfo.c index a489d9d0fb..36ec927b9e 100644 --- a/mailinfo.c +++ b/mailinfo.c @@ -1149,11 +1149,13 @@ void clear_mailinfo(struct mailinfo *mi) strbuf_release(&mi->inbody_header_accum); free(mi->message_id); - for (i = 0; mi->p_hdr_data[i]; i++) - strbuf_release(mi->p_hdr_data[i]); + if (mi->p_hdr_data) + for (i = 0; mi->p_hdr_data[i]; i++) + strbuf_release(mi->p_hdr_data[i]); free(mi->p_hdr_data); - for (i = 0; mi->s_hdr_data[i]; i++) - strbuf_release(mi->s_hdr_data[i]); + if (mi->s_hdr_data) + for (i = 0; mi->s_hdr_data[i]; i++) + strbuf_release(mi->s_hdr_data[i]); free(mi->s_hdr_data); while (mi->content < mi->content_top) { |