In your example *stack, this is a pointer. It is completely safe to free the memory that it points to, and then assign a pointer to a new variable.
The only thing that would be unsafe would be dereferencing *stackafter his release.
free( *stack );
next = (*stack)->next;
, , *stack, ( ) free.