about summary refs log tree commit diff
path: root/elf
diff options
context:
space:
mode:
Diffstat (limited to 'elf')
-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);