Update memory manager

Updated the memory manager module to incorporate updates to free()
from JoeCool17/master.