6.9 — Dynamic memory allocation with new and delete « Learn C++
The address returned from the second allocation overwrites the address of the first allocation. Consequently, the first allocation becomes a memory leak! Null pointers (part II) Null pointers (pointers set to address 0) are particularly useful when dealin...