1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 12:59:41 +01:00

refs/packed-backend.c: close fd of empty file

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller 2018-05-30 10:03:00 -07:00 committed by Junio C Hamano
parent 2161ed8098
commit 09427e8366

View file

@ -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);