If you
#define configUSE_MALLOC_FAILED_HOOK 1
you or your Nordic SDK have to provide a vApplicationMallocFailedHook
implementation as documented e.g. here FreeRTOS - RTOS hook (callback) functions for task stack overflows, tick interrupts, idle task, daemon task startup, and malloc failure (pvPortMalloc() returning NULL).
You could either #define configUSE_MALLOC_FAILED_HOOK 0
or implement it.
Also HeapStats_t
is defined in FreeRTOS include/portable.h.
I wonder why this seems missing in your (custom/Nordic ?) FreeRTOS include/portable.h ?