mirror of
https://github.com/espressif/esp-idf
synced 2025-03-10 01:29:21 -04:00
fix(heap): Wrong size propagated in alloc fail callback
Propagate `n * size` as the size of the failed allocation instead of just `size` when heap_caps_calloc() fails since `n * size` is the actual number of bytes that the heap component tried to allocate.
This commit is contained in:
parent
ff4dba8e8c
commit
cdf5414302
@ -488,7 +488,7 @@ IRAM_ATTR void *heap_caps_calloc( size_t n, size_t size, uint32_t caps)
|
|||||||
void* ptr = heap_caps_calloc_base(n, size, caps);
|
void* ptr = heap_caps_calloc_base(n, size, caps);
|
||||||
|
|
||||||
if (!ptr && size > 0){
|
if (!ptr && size > 0){
|
||||||
heap_caps_alloc_failed(size, caps, __func__);
|
heap_caps_alloc_failed(n * size, caps, __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user