Browse Source

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.
Waldemar Brodkorb 10 years ago
parent
commit
c269f57d32
1 changed files with 1 additions and 1 deletions
  1. 1 1
      libc/stdlib/malloc/realloc.c

+ 1 - 1
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);