From d252c4796b2619b35099d829cb519844c49ee78c Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Sat, 10 Nov 2001 03:23:20 +0000 Subject: (realloc): Handle NULL for first parameter correctly. --- elf/dl-minimal.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'elf') diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index 564da7d..b72faa0 100644 --- a/elf/dl-minimal.c +++ b/elf/dl-minimal.c @@ -111,6 +111,8 @@ void * weak_function realloc (void *ptr, size_t n) { void *new; + if (ptr == NULL) + return malloc (n); assert (ptr == alloc_last_block); alloc_ptr = alloc_last_block; new = malloc (n); -- cgit v1.1