mirror of
https://github.com/git-for-windows/git.git
synced 2026-03-25 01:21:26 -05:00
am: close input stream even in case of an error
Reported via Coverity. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
@@ -762,9 +762,11 @@ static int split_mail_conv(mail_conv_fn fn, struct am_state *state,
|
||||
mail = mkpath("%s/%0*d", state->dir, state->prec, i + 1);
|
||||
|
||||
out = fopen(mail, "w");
|
||||
if (!out)
|
||||
if (!out) {
|
||||
fclose(in);
|
||||
return error_errno(_("could not open '%s' for writing"),
|
||||
mail);
|
||||
}
|
||||
|
||||
ret = fn(out, in, keep_cr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user