Fix a a problem where we free an unallocated object.