current = nullptr;
this line doesn't do anything. It changes a local variable which immediately falls out of scope.
In the next iteration, you will find the same node again, but you freed (delete
) it, so accessing it is undefined behaviour.
You want to update the pointer to this node in the BST to nullptr
.