Introduce _cleanup_free_, apply where most useful.