(realloc): Handle NULL for first parameter correctly.

This commit is contained in:
Ulrich Drepper 2001-11-10 03:23:20 +00:00
parent 7d0c582398
commit d252c4796b
1 changed files with 2 additions and 0 deletions

View File

@ -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);