Browse Source

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
Stefan Beller 7 years ago committed by Junio C Hamano
parent
commit
09427e8366
  1. 1
      refs/packed-backend.c

1
refs/packed-backend.c

@ -499,6 +499,7 @@ static int load_contents(struct snapshot *snapshot) @@ -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);

Loading…
Cancel
Save