summaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-04-26 20:12:17 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-26 20:12:17 +0200
commitbd8e3385d5f61b2518286f81678a24a1cb88416d (patch)
treed44afba1f0cbf527d2067ef508b0819696904e80 /builtin
parentMerge branch 'jk/chopped-ident' into maint (diff)
parentreceive-pack: close sideband fd on early pack errors (diff)
downloadgit-bd8e3385d5f61b2518286f81678a24a1cb88416d.tar.xz
git-bd8e3385d5f61b2518286f81678a24a1cb88416d.zip
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
Diffstat (limited to 'builtin')
-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));