Maybe i am misunderstanding this but as far as i know, vApplicationMallocFailedHook is a user supplied function which is being called by FreeRTOS kernel if it encounters a failed called to malloc. Why would you want to call this here?