summaryrefslogtreecommitdiff
path: root/sha1-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'sha1-file.c')
-rw-r--r--sha1-file.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/sha1-file.c b/sha1-file.c
index 487ea35d2d..4895408e1e 100644
--- a/sha1-file.c
+++ b/sha1-file.c
@@ -952,12 +952,8 @@ void *xmmap_gently(void *start, size_t length,
mmap_limit_check(length);
ret = mmap(start, length, prot, flags, fd, offset);
- if (ret == MAP_FAILED) {
- if (!length)
- return NULL;
- release_pack_memory(length);
- ret = mmap(start, length, prot, flags, fd, offset);
- }
+ if (ret == MAP_FAILED && !length)
+ ret = NULL;
return ret;
}