summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-26 11:12:17 -0700
committerJunio C Hamano <gitster@pobox.com>2013-04-26 11:12:17 -0700
commitbd8e3385d5f61b2518286f81678a24a1cb88416d (patch)
treed44afba1f0cbf527d2067ef508b0819696904e80
parent30e8180b271c9e111fe99442b78a4b249b29e073 (diff)
parent49ecfa13fe6fb9ccb7c4771126872515340c328b (diff)
downloadgit-bd8e3385d5f61b2518286f81678a24a1cb88416d.tar.gz
Merge branch 'jk/receive-pack-deadlocks-with-early-failure' into maint
* jk/receive-pack-deadlocks-with-early-failure: receive-pack: close sideband fd on early pack errors
-rw-r--r--builtin/receive-pack.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index 62ba6e7a3d..89792b0a33 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -828,8 +828,11 @@ static const char *unpack(int err_fd)
: 0);
hdr_err = parse_pack_header(&hdr);
- if (hdr_err)
+ if (hdr_err) {
+ if (err_fd > 0)
+ close(err_fd);
return hdr_err;
+ }
snprintf(hdr_arg, sizeof(hdr_arg),
"--pack_header=%"PRIu32",%"PRIu32,
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));