Skip to content

Commit bd8e338

Browse files
committed
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
2 parents 30e8180 + 49ecfa1 commit bd8e338

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

builtin/receive-pack.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,11 @@ static const char *unpack(int err_fd)
828828
: 0);
829829

830830
hdr_err = parse_pack_header(&hdr);
831-
if (hdr_err)
831+
if (hdr_err) {
832+
if (err_fd > 0)
833+
close(err_fd);
832834
return hdr_err;
835+
}
833836
snprintf(hdr_arg, sizeof(hdr_arg),
834837
"--pack_header=%"PRIu32",%"PRIu32,
835838
ntohl(hdr.hdr_version), ntohl(hdr.hdr_entries));

0 commit comments

Comments
 (0)