mirror of https://github.com/thesofproject/sof.git
108912bba8
When the realloc() function fails, a NULL pointer is returned. But, if the size argument is zero, then also NULL is returned. So, to differentiate that, we also check if size is non zero. Only if pointer is NULL and size is non-zero, we come to the conclusion that realloc() failed and the allocated memory till now is freed and appropriate error is returned. If realloc is called on a pointer and fails, the memory pointed by the pointer isn't freed. When realloc() fails, even this memory is freed. Signed-off-by: Mohana Datta Yelugoti <ymdatta.work@gmail.com> |
||
---|---|---|
.. | ||
include/testbench | ||
CMakeLists.txt | ||
alloc.c | ||
common_test.c | ||
edf_schedule.c | ||
file.c | ||
ipc.c | ||
ll_schedule.c | ||
panic.c | ||
schedule.c | ||
testbench.c | ||
timer.c | ||
topology.c | ||
trace.c |