There are plenty of malloc API helper routines. These can be useful when debugging a difficult scenario; it's a good idea to be aware of what's available.
On an Ubuntu Linux system, we check with man for a match to the keyword malloc:
$ man -k malloc__after_morecore_hook (3) - malloc debugging variables__free_hook (3) - malloc debugging variables__malloc_hook (3) - malloc debugging variables__malloc_initialize_hook (3) - malloc debugging variables__memalign_hook (3) - malloc debugging variables__realloc_hook (3) - malloc debugging variablesmalloc (3) - allocate and free dynamic memorymalloc_get_state (3) - record and restore state of malloc implementationmalloc_hook (3) - malloc debugging variablesmalloc_info ...