Typically something like this:
The red line looses the pointer you got back in the blue line - so the memory you got back from the blue line can not be freed, because you no longer hold a pointer to it.Code:int *p = new int(42); ... // no line doing "delete p" here... p = new int(17);
[The same would happen if p is assigned 0, or &x, or any other change of the value of p].
--
Mats