Explorar el Código

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
Marius Vikhammer hace 2 años
padre
commit
5b77f77e53
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  1. 1 1
      components/heap/heap_caps_linux.c

+ 1 - 1
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)
 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) {
     if (ptr == NULL && size > 0) {
         heap_caps_alloc_failed(size, caps, __func__);
         heap_caps_alloc_failed(size, caps, __func__);