summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2015-04-09 13:47:06 -0500
committerWaldemar Brodkorb <wbx@openadk.org>2015-04-13 00:26:40 -0500
commitc269f57d321991998a0aa5cc482c7e0124ccd45f (patch)
tree3a9e5e211b8b58c32374174acd21be19d8716e26
parentbbe05b64872728cd3d78ed0ef06ac963a40c4400 (diff)
return NULL for realloc(p,0) like glibc
See discussion here about the issue: https://sourceware.org/bugzilla/show_bug.cgi?id=12547 Fixes testsuite errors.
-rw-r--r--libc/stdlib/malloc/realloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index 8de00665f..8d55289c5 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -30,7 +30,7 @@ realloc (void *mem, size_t new_size)
if (! new_size)
{
free (mem);
- return malloc (new_size);
+ return NULL;
}
if (! mem)
return malloc (new_size);