summaryrefslogtreecommitdiff
path: root/mailinfo.c
diff options
context:
space:
mode:
authorRene Scharfe <l.s.r@web.de>2017-08-30 17:49:47 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-09-06 23:49:27 (GMT)
commit11fa5e2a81cc921b55a4a91f2e5f39d423f18467 (patch)
tree5b147842a66af339f0e678ed22dcb4364b61afb8 /mailinfo.c
parentbad0e2c6a89b52b0d6b2ebae6e290b6d4e6f799c (diff)
downloadgit-11fa5e2a81cc921b55a4a91f2e5f39d423f18467.zip
git-11fa5e2a81cc921b55a4a91f2e5f39d423f18467.tar.gz
git-11fa5e2a81cc921b55a4a91f2e5f39d423f18467.tar.bz2
mailinfo: release strbuf after use in handle_from()
Clean up at the end and jump there instead of returning early. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'mailinfo.c')
-rw-r--r--mailinfo.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/mailinfo.c b/mailinfo.c
index bd574cb..b1f5159 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);
}