From 5b77f77e530e86768e4eab615730474b131fef55 Mon Sep 17 00:00:00 2001 From: Marius Vikhammer Date: Mon, 29 May 2023 10:09:54 +0800 Subject: [PATCH] core-system/linux-target: fixed heap_caps_realloc not correctly allocating the requested number of bytes Closes https://github.com/espressif/esp-idf/issues/11523 --- components/heap/heap_caps_linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/heap/heap_caps_linux.c b/components/heap/heap_caps_linux.c index 981f861674..67746132de 100644 --- a/components/heap/heap_caps_linux.c +++ b/components/heap/heap_caps_linux.c @@ -80,7 +80,7 @@ void *heap_caps_malloc_prefer( size_t size, size_t num, ... ) static void *heap_caps_realloc_base( void *ptr, size_t size, uint32_t caps) { - ptr = realloc(ptr, caps); + ptr = realloc(ptr, size); if (ptr == NULL && size > 0) { heap_caps_alloc_failed(size, caps, __func__);