Skip to content

Commit

Permalink
Add check for NULL input pointer (#53) (#54)
Browse files Browse the repository at this point in the history
(cherry picked from commit 3544e5b)

Co-authored-by: Antonio Cuadros <[email protected]>
  • Loading branch information
mergify[bot] and Acuadros95 authored Mar 25, 2022
1 parent abe1c1a commit 3e2a747
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 3e2a747

Please sign in to comment.