Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
am: release strbuf after use in split_mail_mbox()
author
René Scharfe
<l.s.r@web.de>
Thu, 7 Dec 2017 20:20:19 +0000
(21:20 +0100)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 7 Dec 2017 20:30:04 +0000
(12:30 -0800)
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/am.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
e97a5e7
)
diff --git
a/builtin/am.c
b/builtin/am.c
index 1399c8dd880f86190534b9c9e0a5e84f48ebeceb..23688537638427704d77354a1b85a048c045dfa6 100644
(file)
--- a/
builtin/am.c
+++ b/
builtin/am.c
@@
-702,6
+702,7
@@
static int split_mail_mbox(struct am_state *state, const char **paths, int keep_
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf last = STRBUF_INIT;
{
struct child_process cp = CHILD_PROCESS_INIT;
struct strbuf last = STRBUF_INIT;
+ int ret;
cp.git_cmd = 1;
argv_array_push(&cp.args, "mailsplit");
cp.git_cmd = 1;
argv_array_push(&cp.args, "mailsplit");
@@
-713,13
+714,16
@@
static int split_mail_mbox(struct am_state *state, const char **paths, int keep_
argv_array_push(&cp.args, "--");
argv_array_pushv(&cp.args, paths);
argv_array_push(&cp.args, "--");
argv_array_pushv(&cp.args, paths);
- if (capture_command(&cp, &last, 8))
- return -1;
+ ret = capture_command(&cp, &last, 8);
+ if (ret)
+ goto exit;
state->cur = 1;
state->last = strtol(last.buf, NULL, 10);
state->cur = 1;
state->last = strtol(last.buf, NULL, 10);
- return 0;
+exit:
+ strbuf_release(&last);
+ return ret ? -1 : 0;
}
/**
}
/**