Merge branch 'rs/am-builtin-leakfix'
Leakfix. * rs/am-builtin-leakfix: am: release strbuf after use in split_mail_mbox()
This commit is contained in:
commit
5c14bd6175
10
builtin/am.c
10
builtin/am.c
@ -708,6 +708,7 @@ static int split_mail_mbox(struct am_state *state, const char **paths,
|
|||||||
{
|
{
|
||||||
struct child_process cp = CHILD_PROCESS_INIT;
|
struct child_process cp = CHILD_PROCESS_INIT;
|
||||||
struct strbuf last = STRBUF_INIT;
|
struct strbuf last = STRBUF_INIT;
|
||||||
|
int ret;
|
||||||
|
|
||||||
cp.git_cmd = 1;
|
cp.git_cmd = 1;
|
||||||
argv_array_push(&cp.args, "mailsplit");
|
argv_array_push(&cp.args, "mailsplit");
|
||||||
@ -721,13 +722,16 @@ static int split_mail_mbox(struct am_state *state, const char **paths,
|
|||||||
argv_array_push(&cp.args, "--");
|
argv_array_push(&cp.args, "--");
|
||||||
argv_array_pushv(&cp.args, paths);
|
argv_array_pushv(&cp.args, paths);
|
||||||
|
|
||||||
if (capture_command(&cp, &last, 8))
|
ret = capture_command(&cp, &last, 8);
|
||||||
return -1;
|
if (ret)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
state->cur = 1;
|
state->cur = 1;
|
||||||
state->last = strtol(last.buf, NULL, 10);
|
state->last = strtol(last.buf, NULL, 10);
|
||||||
|
|
||||||
return 0;
|
exit:
|
||||||
|
strbuf_release(&last);
|
||||||
|
return ret ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user