kopia lustrzana https://github.com/espressif/esp-idf
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.pull/13550/head
rodzic
52137a2b55
commit
497c840172
|
@ -529,7 +529,7 @@ HEAP_IRAM_ATTR void *heap_caps_calloc( size_t n, size_t size, uint32_t caps)
|
|||
|
||||
|
||||
if (!ptr && size > 0){
|
||||
heap_caps_alloc_failed(size, caps, __func__);
|
||||
heap_caps_alloc_failed(n * size, caps, __func__);
|
||||
}
|
||||
|
||||
return ptr;
|
||||
|
|
Ładowanie…
Reference in New Issue