aboutsummaryrefslogtreecommitdiff
path: root/malloc/arena.c
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/arena.c')
-rw-r--r--malloc/arena.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/malloc/arena.c b/malloc/arena.c
index ed5a4d5cd3..229783f3b7 100644
--- a/malloc/arena.c
+++ b/malloc/arena.c
@@ -771,14 +771,12 @@ reused_arena (mstate avoid_arena)
{
result = result->next;
if (result == begin)
- break;
+ /* We looped around the arena list. We could not find any
+ arena that was either not corrupted or not the one we
+ wanted to avoid. */
+ return NULL;
}
- /* We could not find any arena that was either not corrupted or not the one
- we wanted to avoid. */
- if (result == begin || result == avoid_arena)
- return NULL;
-
/* No arena available without contention. Wait for the next in line. */
LIBC_PROBE (memory_arena_reuse_wait, 3, &result->mutex, result, avoid_arena);
(void) mutex_lock (&result->mutex);