X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=mailinfo.c;h=f2387a32675591d6da83473ef6235ba823721d1c;hb=94982b69994c448dafbc0721398f8944ab5856e3;hp=bd574cb75210334b1a4628f182743b49bd389cd7;hpb=c7759cd60ab0213024c3fbe9a163dcd49b2bb838;p=git-core%2Fgit.git diff --git a/mailinfo.c b/mailinfo.c index bd574cb75..f2387a326 100644 --- a/mailinfo.c +++ b/mailinfo.c @@ -149,16 +149,14 @@ static void handle_from(struct mailinfo *mi, const struct strbuf *from) at = strchr(f.buf, '@'); if (!at) { parse_bogus_from(mi, from); - return; + goto out; } /* * If we already have one email, don't take any confusing lines */ - if (mi->email.len && strchr(at + 1, '@')) { - strbuf_release(&f); - return; - } + if (mi->email.len && strchr(at + 1, '@')) + goto out; /* Pick up the string around '@', possibly delimited with <> * pair; that is the email part. @@ -198,6 +196,7 @@ static void handle_from(struct mailinfo *mi, const struct strbuf *from) } get_sane_name(&mi->name, &f, &mi->email); +out: strbuf_release(&f); } @@ -929,6 +928,7 @@ again: error("Detected mismatched boundaries, can't recover"); mi->input_error = -1; mi->content_top = mi->content; + strbuf_release(&newline); return 0; } handle_filter(mi, &newline);