diff options
-rw-r--r-- | builtin/receive-pack.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index e6b3879a5b..eb6d25a149 100644 --- a/builtin/receive-pack.c +++ b/builtin/receive-pack.c @@ -1664,8 +1664,11 @@ static const char *unpack(int err_fd, struct shallow_info *si) } tmp_objdir = tmp_objdir_create(); - if (!tmp_objdir) + if (!tmp_objdir) { + if (err_fd > 0) + close(err_fd); return "unable to create temporary object directory"; + } child.env = tmp_objdir_env(tmp_objdir); /* |