Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
mailinfo: release strbuf after use in handle_from()
author
Rene Scharfe
<l.s.r@web.de>
Wed, 30 Aug 2017 17:49:47 +0000
(19:49 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Wed, 6 Sep 2017 23:49:27 +0000
(08:49 +0900)
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>
mailinfo.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
bad0e2c
)
diff --git
a/mailinfo.c
b/mailinfo.c
index bd574cb75210334b1a4628f182743b49bd389cd7..b1f515954608634551289f9a7142c46385187027 100644
(file)
--- 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);
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 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.
/* 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);
}
get_sane_name(&mi->name, &f, &mi->email);
+out:
strbuf_release(&f);
}
strbuf_release(&f);
}