aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-12-11 23:46:43 +0000
committerUlrich Drepper <drepper@redhat.com>2007-12-11 23:46:43 +0000
commit17edb30c62d6e0d84f1e9b40e7df3a43b254f551 (patch)
tree4a68df042167227438836c53e78871518476f01d
parent65bc770f4e1333883c4c95ffa63d49136404a2d8 (diff)
downloadglibc-17edb30c62d6e0d84f1e9b40e7df3a43b254f551.zip
glibc-17edb30c62d6e0d84f1e9b40e7df3a43b254f551.tar.gz
glibc-17edb30c62d6e0d84f1e9b40e7df3a43b254f551.tar.bz2
* malloc/malloc.c (_int_malloc): sYSMALLOc might fail, in this
case don't call alloc_perturb.
-rw-r--r--ChangeLog5
-rw-r--r--malloc/malloc.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c94d0e4..531d6b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-12-11 Ulrich Drepper <drepper@redhat.com>
+
+ * malloc/malloc.c (_int_malloc): sYSMALLOc might fail, in this
+ case don't call alloc_perturb.
+
2007-12-10 Ulrich Drepper <drepper@redhat.com>
* sysdeps/unix/sysv/linux/adjtime.c: Use ADJ_OFFSET_SS_READ if
diff --git a/malloc/malloc.c b/malloc/malloc.c
index 39d5b3f..1e71608 100644
--- a/malloc/malloc.c
+++ b/malloc/malloc.c
@@ -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;
}