Skip to content

Commit 46241b8

Browse files
committed
Fix calling pvPortMalloc on FreeRTOS with size zero resulting in vApplicationMallocFailedHook getting called and FreeRTOS asserting
1 parent b10fdb6 commit 46241b8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

erpc_c/port/erpc_port_freertos.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ void operator delete[](void *ptr) THROW
5555

5656
void *erpc_malloc(size_t size)
5757
{
58+
if (size == 0) {
59+
return nullptr;
60+
}
5861
void *p = pvPortMalloc(size);
5962
return p;
6063
}

0 commit comments

Comments
 (0)