diff --git a/run-command.c b/run-command.c index e996b21426..c13072d77c 100644 --- a/run-command.c +++ b/run-command.c @@ -385,6 +385,8 @@ fail_pipe: close(cmd->out); if (need_err) close_pair(fderr); + else if (cmd->err) + close(cmd->err); errno = failed_errno; return -1; }