Implements a basic error detecting malloc/free functions in C