From 08986fd5b5774fd9fd4f10537ea54f08daed10e0 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Fri, 19 Jun 2026 10:17:33 +0900 Subject: [PATCH] fix(heap): reset alloc_stat before realloc lookup Closes https://github.com/espressif/esp-idf/issues/18723 Closes https://github.com/espressif/esp-idf/pull/18724 --- components/heap/heap_task_info.c | 1 + 1 file changed, 1 insertion(+) diff --git a/components/heap/heap_task_info.c b/components/heap/heap_task_info.c index 30c168e6bbf..e992040dccb 100644 --- a/components/heap/heap_task_info.c +++ b/components/heap/heap_task_info.c @@ -343,6 +343,7 @@ HEAP_IRAM_ATTR void heap_caps_update_per_task_info_realloc(heap_t *heap, void *o /* remove the alloc from the list. The updated alloc stats are added later * in the function */ + alloc_stat = NULL; STAILQ_FOREACH(alloc_stat, &heap_stats->allocs_stats, next_alloc_stat) { if (alloc_stat->alloc_stat.address == old_ptr) { STAILQ_REMOVE(&heap_stats->allocs_stats, alloc_stat, alloc_stats, next_alloc_stat);