Output mallopt M_CHECK_ACTION error to log file
===

I'm trying to protect my process from a potential rouge code that might cause a double-free scenario using mallopt(M_CHECK_ACTION, 3).

Is there a way to output the error in case of a double-free to a log file? 
My process already redirects stderr (i.e "error" calls are logged to a file), but this specific error is printed to the screen.