Check to make sure that ptr is in the memory space in mem_free