summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Evans <jasone@canonware.com>2014-03-28 04:45:03 (GMT)
committerJason Evans <jasone@canonware.com>2014-03-28 04:45:03 (GMT)
commit67fd1e0700909381a71fd04d9cbd3d81fa5f0430 (patch)
treeab971c048ac106bbc3073786333b2430666937a0
parent9e20df163c0c608026498b8fb5beab35e8a049c6 (diff)
parent20a8c78bfe3310e0f0f72b596d4e10ca7336063b (diff)
downloadjemalloc-67fd1e0700909381a71fd04d9cbd3d81fa5f0430.zip
jemalloc-67fd1e0700909381a71fd04d9cbd3d81fa5f0430.tar.gz
jemalloc-67fd1e0700909381a71fd04d9cbd3d81fa5f0430.tar.bz2
Merge pull request #60 from telemenar/dev
Fix a crashing case where arena_chunk_init_hard returns NULL.
-rw-r--r--src/arena.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/arena.c b/src/arena.c
index 390ab0f..dad707b 100644
--- a/src/arena.c
+++ b/src/arena.c
@@ -614,8 +614,11 @@ arena_chunk_alloc(arena_t *arena)
if (arena->spare != NULL)
chunk = arena_chunk_init_spare(arena);
- else
+ else {
chunk = arena_chunk_init_hard(arena);
+ if (chunk == NULL)
+ return (NULL);
+ }
/* Insert the run into the runs_avail tree. */
arena_avail_insert(arena, chunk, map_bias, chunk_npages-map_bias,