From: Ulrich Drepper Date: Sat, 10 Nov 2001 03:23:20 +0000 (+0000) Subject: (realloc): Handle NULL for first parameter correctly. X-Git-Tag: cvs/glibc-2-2-5~168 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d252c4796b2619b35099d829cb519844c49ee78c;p=thirdparty%2Fglibc.git (realloc): Handle NULL for first parameter correctly. --- diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c index 564da7dfcf7..b72faa0aa76 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);