mirror of git://sourceware.org/git/glibc.git
(realloc): Handle NULL for first parameter correctly.
This commit is contained in:
parent
7d0c582398
commit
d252c4796b
|
@ -111,6 +111,8 @@ void * weak_function
|
||||||
realloc (void *ptr, size_t n)
|
realloc (void *ptr, size_t n)
|
||||||
{
|
{
|
||||||
void *new;
|
void *new;
|
||||||
|
if (ptr == NULL)
|
||||||
|
return malloc (n);
|
||||||
assert (ptr == alloc_last_block);
|
assert (ptr == alloc_last_block);
|
||||||
alloc_ptr = alloc_last_block;
|
alloc_ptr = alloc_last_block;
|
||||||
new = malloc (n);
|
new = malloc (n);
|
||||||
|
|
Loading…
Reference in New Issue