To free memory that was previously allocated from the heap, use the free memory function, mem_free():
void mem_free(p) PTR p; /* Pointer to memory to be freed */
No error checking is done by mem_free().