delete a temporary allocated pointer