What happens is not defined by the Standard. As far as C++ is concerned the address is invalid and should not be used. What happens if you use it anyway is anybody's guess.
In practice, that memory is usually sitting there until something else needs it. All you've done is said, "I don't need it anymore." You can still access it for a while afterward, leading you to make very bad assumptions about the fitness of your code, but it can be reclaimed and reassigned at any time.
If the process needs memory for something else, maybe it gets that which was pointed at by data
. In this case using data
could corrupt memory used by another part of your program. This is a really bad scene because it's hard to track down what really happened when something totally unrelated to the bug crashes the program.
If another process needs memory, maybe the underlying system takes the memory back and gives it to the other process. On a modern PC accessing data
after the memory's been given to the other process will be fatal.