summaryrefslogtreecommitdiff
path: root/elf/dl-minimal.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-11-10 03:23:20 +0000
committerUlrich Drepper <drepper@redhat.com>2001-11-10 03:23:20 +0000
commitd252c4796b2619b35099d829cb519844c49ee78c (patch)
tree2737a420aa7e0886568e701375ca476573e43b36 /elf/dl-minimal.c
parent7d0c5823985d8d2be48cbc23b5099633bedceef4 (diff)
(realloc): Handle NULL for first parameter correctly.
Diffstat (limited to 'elf/dl-minimal.c')
-rw-r--r--elf/dl-minimal.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/elf/dl-minimal.c b/elf/dl-minimal.c
index 564da7dfcf..b72faa0aa7 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);