summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--refs/packed-backend.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/refs/packed-backend.c b/refs/packed-backend.c
index cec3fb9e00..d447a731da 100644
--- a/refs/packed-backend.c
+++ b/refs/packed-backend.c
@@ -499,6 +499,7 @@ static int load_contents(struct snapshot *snapshot)
size = xsize_t(st.st_size);
if (!size) {
+ close(fd);
return 0;
} else if (mmap_strategy == MMAP_NONE || size <= SMALL_FILE_SIZE) {
snapshot->buf = xmalloc(size);