diff options
author | Mike Frysinger <vapier@gentoo.org> | 2005-07-06 01:23:08 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2005-07-06 01:23:08 +0000 |
commit | 629ec28ed6473baf96d26fd1d395496c634bc921 (patch) | |
tree | 4b3aa76121b4aff1c8eb5c9628619f1c8c8801e6 | |
parent | f934cd05300c0683f78bbeb1d9697bd947df0854 (diff) |
add support for __MALLOC_GLIBC_COMPAT__ (malloc(0) == NULL) so the malloc test wont fail
-rw-r--r-- | libc/stdlib/malloc-standard/malloc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libc/stdlib/malloc-standard/malloc.c b/libc/stdlib/malloc-standard/malloc.c index 51e02a240..7025e8335 100644 --- a/libc/stdlib/malloc-standard/malloc.c +++ b/libc/stdlib/malloc-standard/malloc.c @@ -827,6 +827,10 @@ void* malloc(size_t bytes) mchunkptr bck; /* misc temp for linking */ void * sysmem; +#if !defined(__MALLOC_GLIBC_COMPAT__) + if (!bytes) return NULL; +#endif + LOCK; av = get_malloc_state(); /* |