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

* malloc/malloc.c (_int_malloc): sYSMALLOc might fail, in this

case don't call alloc_perturb.
This commit is contained in:
Ulrich Drepper
2007-12-11 23:46:43 +00:00
parent 65bc770f4e
commit 17edb30c62
2 changed files with 7 additions and 2 deletions

View File

@ -4475,7 +4475,7 @@ _int_malloc(mstate av, size_t bytes)
We require that av->top always exists (i.e., has size >=
MINSIZE) after initialization, so if it would otherwise be
exhuasted by current request, it is replenished. (The main
exhausted by current request, it is replenished. (The main
reason for ensuring it exists is that we may need MINSIZE space
to put in fenceposts in sysmalloc.)
*/
@ -4515,7 +4515,7 @@ _int_malloc(mstate av, size_t bytes)
*/
else {
void *p = sYSMALLOc(nb, av);
if (__builtin_expect (perturb_byte, 0))
if (p != NULL && __builtin_expect (perturb_byte, 0))
alloc_perturb (p, bytes);
return p;
}