projects
/
platform
/
upstream
/
glibc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
(realloc): Handle NULL for first parameter correctly.
[platform/upstream/glibc.git]
/
elf
/
dl-minimal.c
diff --git
a/elf/dl-minimal.c
b/elf/dl-minimal.c
index
564da7d
..
b72faa0
100644
(file)
--- 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);