summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-02-26 16:31:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-02-26 22:42:27 (GMT)
commit66f52fa26b4facbf79e3f74d8bc95f8ac8535c50 (patch)
treeeb7d524c705994d57fc3e63676155390ecf85d5f /contrib
parent6885cd7dc573b1750b8d895820b8b2f56285f070 (diff)
downloadgit-66f52fa26b4facbf79e3f74d8bc95f8ac8535c50.zip
git-66f52fa26b4facbf79e3f74d8bc95f8ac8535c50.tar.gz
git-66f52fa26b4facbf79e3f74d8bc95f8ac8535c50.tar.bz2
pack-revindex.c: don't close unopened file descriptors
When opening a reverse index, load_revindex_from_disk() jumps to the 'cleanup' label in case something goes wrong: the reverse index had the wrong size, an unrecognized version, or similar. It also jumps to this label when the reverse index couldn't be opened in the first place, which will cause an error with the unguarded close() call in the label. Guard this call with "if (fd >= 0)" to make sure that we have a valid file descriptor to close before attempting to close it. Reported-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
0 files changed, 0 insertions, 0 deletions