projects
/
git.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
[PATCH] Fix warning about non-void return in a void function.
[git.git]
/
diff.c
diff --git
a/diff.c
b/diff.c
index
4a4b621
..
361d7c0
100644
(file)
--- a/
diff.c
+++ b/
diff.c
@@
-377,8
+377,10
@@
int diff_populate_filespec(struct diff_filespec *s, int size_only)
if (fd < 0)
goto err_empty;
s->data = mmap(NULL, s->size, PROT_READ, MAP_PRIVATE, fd, 0);
- s->should_munmap = 1;
close(fd);
+ if (s->data == MAP_FAILED)
+ goto err_empty;
+ s->should_munmap = 1;
}
else {
char type[20];