fixed ptr type in free()