From 817349ad39e6c006084b6adb4110981981666480 Mon Sep 17 00:00:00 2001 From: Guillaume Souchere Date: Tue, 19 Mar 2024 13:51:43 +0100 Subject: [PATCH] fix(tlsf): Fix while loop in walker Exit the loop before getting the next block if the pool_walker returns false. --- tlsf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tlsf.c b/tlsf.c index bd20da9..95deaa8 100644 --- a/tlsf.c +++ b/tlsf.c @@ -773,7 +773,10 @@ void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user) block_size(block), !block_is_free(block), user); - block = block_next(block); + + if (ret_val == true) { + block = block_next(block); + } } }