Pointer being freed is not allocated?