summaryrefslogtreecommitdiff
path: root/libc/stdlib
diff options
context:
space:
mode:
Diffstat (limited to 'libc/stdlib')
-rw-r--r--libc/stdlib/malloc/realloc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/stdlib/malloc/realloc.c b/libc/stdlib/malloc/realloc.c
index 0cf83e2bd..4d56565aa 100644
--- a/libc/stdlib/malloc/realloc.c
+++ b/libc/stdlib/malloc/realloc.c
@@ -28,13 +28,13 @@ realloc (void *mem, size_t new_size)
char *base_mem;
/* Check for special cases. */
- if (! mem)
- return malloc (new_size);
if (! new_size)
{
free (mem);
return malloc (new_size);
}
+ if (! mem)
+ return malloc (new_size);
/* Normal realloc. */