Merge branch 'rs/sha1-file-close-mapped-file-on-error'
Code clean-up. * rs/sha1-file-close-mapped-file-on-error: sha1-file: close fd of empty file in map_sha1_file_1()
This commit is contained in:
commit
2c0a645d9e
@ -960,6 +960,7 @@ static void *map_sha1_file_1(struct repository *r, const char *path,
|
||||
if (!*size) {
|
||||
/* mmap() is forbidden on empty files */
|
||||
error(_("object file %s is empty"), path);
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user