summaryrefslogtreecommitdiff
path: root/mailinfo.c
diff options
context:
space:
mode:
Diffstat (limited to 'mailinfo.c')
-rw-r--r--mailinfo.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mailinfo.c b/mailinfo.c
index a89db22ab0..3281a37d51 100644
--- a/mailinfo.c
+++ b/mailinfo.c
@@ -716,7 +716,7 @@ static void flush_inbody_header_accum(struct mailinfo *mi)
if (!mi->inbody_header_accum.len)
return;
if (!check_header(mi, &mi->inbody_header_accum, mi->s_hdr_data, 0))
- die("BUG: inbody_header_accum, if not empty, must always contain a valid in-body header");
+ BUG("inbody_header_accum, if not empty, must always contain a valid in-body header");
strbuf_reset(&mi->inbody_header_accum);
}
@@ -1167,11 +1167,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) {