Commit bffce882 authored by Junio C Hamano's avatar Junio C Hamano

Merge branch 'jc/mailinfo-cleanup-fix' into maint

Corner case bugfix.

* jc/mailinfo-cleanup-fix:
  mailinfo: avoid segfault when can't open files
parents b502aa4f 4e801463
......@@ -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) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment