You can increase the size of the heap - how that is done depends on the allocation scheme you are using https://www.freertos.org/a00111.html
You can also tune the RAM used by your buffers https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/TCP_IP_Configuration_Examples.html or statically allocate your buffers https://www.freertos.org/FreeRTOS-Plus/FreeRTOS_Plus_TCP/Embedded_Ethernet_Buffer_Management.html
…but in all cases running out of heap should not be a critical error, but handled gracefully. The malloc failed hook is just a convenient notification that it happened.