mirror of https://github.com/thesofproject/sof.git
zephyr/wrapper: Handle OOM correctly in rzalloc()
Fuzzing caught this function failing to handle a heap failure and crashing. Signed-off-by: Andy Ross <andyross@google.com>
This commit is contained in:
parent
572a08ea2c
commit
3ae99d937a
|
@ -306,6 +306,7 @@ void *rzalloc(enum mem_zone zone, uint32_t flags, uint32_t caps, size_t bytes)
|
||||||
{
|
{
|
||||||
void *ptr = rmalloc(zone, flags, caps, bytes);
|
void *ptr = rmalloc(zone, flags, caps, bytes);
|
||||||
|
|
||||||
|
if (ptr)
|
||||||
memset(ptr, 0, bytes);
|
memset(ptr, 0, bytes);
|
||||||
|
|
||||||
return ptr;
|
return ptr;
|
||||||
|
|
Loading…
Reference in New Issue