projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a23baf5
)
fix simple_malloc malloc(0) behavior not to return non-unique pointers
author
Rich Felker
<dalias@aerifal.cx>
Sun, 20 Feb 2011 21:12:09 +0000
(16:12 -0500)
committer
Rich Felker
<dalias@aerifal.cx>
Sun, 20 Feb 2011 21:12:09 +0000
(16:12 -0500)
src/malloc/__simple_malloc.c
patch
|
blob
|
history
diff --git
a/src/malloc/__simple_malloc.c
b/src/malloc/__simple_malloc.c
index 61cd9fc491b914e2bd8e9508f82a9a96e2397414..c029342c88774b5e6b4e026bc29b82e1b81d18cd 100644
(file)
--- a/
src/malloc/__simple_malloc.c
+++ b/
src/malloc/__simple_malloc.c
@@
-15,6
+15,7
@@
void *__simple_malloc(size_t n)
static int lock;
size_t align=1;
+ if (!n) return 0;
if (n > SIZE_MAX/2) goto toobig;
while (align<n && align<ALIGN)