From 09427e8366003ce3d99b0b5a84e42416cef35696 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Wed, 30 May 2018 10:03:00 -0700 Subject: refs/packed-backend.c: close fd of empty file Signed-off-by: Stefan Beller Acked-by: Michael Haggerty Signed-off-by: Junio C Hamano --- refs/packed-backend.c | 1 + 1 file changed, 1 insertion(+) (limited to 'refs') 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); -- cgit v1.2.3