From: Rich Felker Date: Sun, 20 Feb 2011 21:12:09 +0000 (-0500) Subject: fix simple_malloc malloc(0) behavior not to return non-unique pointers X-Git-Tag: v0.7.0~75 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=598a0147cde14d093d17b81c102a1757b5ef9975;p=oweals%2Fmusl.git fix simple_malloc malloc(0) behavior not to return non-unique pointers --- diff --git a/src/malloc/__simple_malloc.c b/src/malloc/__simple_malloc.c index 61cd9fc4..c029342c 100644 --- 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