1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

(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

View File

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