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>maint
parent
2161ed8098
commit
09427e8366
|
@ -499,6 +499,7 @@ static int load_contents(struct snapshot *snapshot)
|
||||||
size = xsize_t(st.st_size);
|
size = xsize_t(st.st_size);
|
||||||
|
|
||||||
if (!size) {
|
if (!size) {
|
||||||
|
close(fd);
|
||||||
return 0;
|
return 0;
|
||||||
} else if (mmap_strategy == MMAP_NONE || size <= SMALL_FILE_SIZE) {
|
} else if (mmap_strategy == MMAP_NONE || size <= SMALL_FILE_SIZE) {
|
||||||
snapshot->buf = xmalloc(size);
|
snapshot->buf = xmalloc(size);
|
||||||
|
|
Loading…
Reference in New Issue