diff options
author | Stefan Beller <sbeller@google.com> | 2018-05-30 19:03:00 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-01 03:49:53 +0200 |
commit | 09427e8366003ce3d99b0b5a84e42416cef35696 (patch) | |
tree | 42ba546f34185f1b87eb8aa742b7e3b87f636de3 /refs | |
parent | RelNotes: remove duplicate release note (diff) | |
download | git-09427e8366003ce3d99b0b5a84e42416cef35696.tar.xz git-09427e8366003ce3d99b0b5a84e42416cef35696.zip |
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>
Diffstat (limited to 'refs')
-rw-r--r-- | refs/packed-backend.c | 1 |
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); |