diff --git a/portable/MemMang/heap_6.c b/portable/MemMang/heap_6.c index 0a1b504de..2360d5782 100644 --- a/portable/MemMang/heap_6.c +++ b/portable/MemMang/heap_6.c @@ -115,10 +115,6 @@ else { buf=heap_alloc_from_foot(heap, size); } -#if(configUSE_MALLOC_FAILED_HOOK==1) -if(buf==NULL) - vApplicationMallocFailedHook(); -#endif return buf; } @@ -1779,6 +1775,10 @@ if(locked) heap_unlock(locked); if(buf!=NULL) xSuccessfulAllocations++; +#if(configUSE_MALLOC_FAILED_HOOK==1) +if(buf==NULL) + vApplicationMallocFailedHook(); +#endif return buf; }