提交 09427e83 编写于 作者: S Stefan Beller 提交者: Junio C Hamano

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

Signed-off-by: NStefan Beller <sbeller@google.com>
Acked-by: NMichael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 2161ed80
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册