path: root/builtin/receive-pack.c
diff options
authorJunio C Hamano <>2017-03-24 19:57:52 (GMT)
committerJunio C Hamano <>2017-03-24 19:57:52 (GMT)
commitf4d3af185988ad45ebc0a6dead32222cad2c03a6 (patch)
treecdfbacf6e120e2eddfa417ad203a40e8dcafc3ae /builtin/receive-pack.c
parent296ab786eed237b59f76f6411e895cc1e3ce14ab (diff)
parentd1a13d3fcb252631361a961cb5e2bf10ed467cba (diff)
Merge branch 'jk/push-deadlock-regression-fix' into maint
"git push" had a handful of codepaths that could lead to a deadlock when unexpected error happened, which has been fixed. * jk/push-deadlock-regression-fix: send-pack: report signal death of pack-objects send-pack: read "unpack" status even on pack-objects failure send-pack: improve unpack-status error messages send-pack: use skip_prefix for parsing unpack status send-pack: extract parsing of "unpack" response receive-pack: fix deadlock when we cannot create tmpdir
Diffstat (limited to 'builtin/receive-pack.c')
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 1dbb8a0..8672825 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);