Skip to content

Commit 800cc62

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

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

erpc_c/port/erpc_port_freertos.cpp

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

5656
void *erpc_malloc(size_t size)
5757
{
58+
if (size == 0)
59+
{
60+
return nullptr;
61+
}
5862
void *p = pvPortMalloc(size);
5963
return p;
6064
}

0 commit comments

Comments
 (0)