Skip to content

Commit

Permalink
Add check for NULL input pointer (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Acuadros95 authored Mar 25, 2022
1 parent 5b627a1 commit 3544e5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion extra_sources/custom_memory_manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void *pvPortReallocMicroROS( void *pv, size_t xWantedSize )
vTaskSuspendAll();

void * newmem = pvPortMallocMicroROS(xWantedSize);
if (newmem != NULL)
if (newmem != NULL && pv != NULL)
{
size_t count = getBlockSize(pv) - xHeapStructSize;
if (xWantedSize < count)
Expand Down

0 comments on commit 3544e5b

Please sign in to comment.