summaryrefslogtreecommitdiffstats
path: root/src/chunk.c
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2015-02-12 20:46:30 (GMT)
committerDaniel Micay <danielmicay@gmail.com>2015-02-12 20:46:30 (GMT)
commit1eaf3b6f345e0b5835549f19e844c81314c90435 (patch)
treea80e934868e8df7a991cd53833564027e9e1cec1 /src/chunk.c
parentcbf3a6d70371d2390b8b0e76814e04cc6088002c (diff)
downloadjemalloc-1eaf3b6f345e0b5835549f19e844c81314c90435.zip
jemalloc-1eaf3b6f345e0b5835549f19e844c81314c90435.tar.gz
jemalloc-1eaf3b6f345e0b5835549f19e844c81314c90435.tar.bz2
add missing check for new_addr chunk size
8ddc93293cd8370870f221225ef1e013fbff6d65 switched this to over using the address tree in order to avoid false negatives, so it now needs to check that the size of the free extent is large enough to satisfy the request.
Diffstat (limited to 'src/chunk.c')
-rw-r--r--src/chunk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/chunk.c b/src/chunk.c
index 6f705de..b357619 100644
--- a/src/chunk.c
+++ b/src/chunk.c
@@ -82,7 +82,7 @@ chunk_recycle(arena_t *arena, extent_tree_t *chunks_szad,
malloc_mutex_lock(&arena->chunks_mtx);
node = (new_addr != NULL) ? extent_tree_ad_search(chunks_ad, &key) :
extent_tree_szad_nsearch(chunks_szad, &key);
- if (node == NULL) {
+ if (node == NULL || (new_addr != NULL && node->size < size)) {
malloc_mutex_unlock(&arena->chunks_mtx);
return (NULL);
}