diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-26 11:12:17 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-26 11:12:17 -0700 |
commit | bd8e3385d5f61b2518286f81678a24a1cb88416d (patch) | |
tree | d44afba1f0cbf527d2067ef508b0819696904e80 /builtin | |
parent | 30e8180b271c9e111fe99442b78a4b249b29e073 (diff) | |
parent | 49ecfa13fe6fb9ccb7c4771126872515340c328b (diff) | |
download | git-bd8e3385d5f61b2518286f81678a24a1cb88416d.tar.gz git-bd8e3385d5f61b2518286f81678a24a1cb88416d.tar.xz |
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.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c index 62ba6e7a3..89792b0a3 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)); |