It’s undefined behavior serious (it could work, it could crash, it could do something else).
More Related Contents:
- Is “delete this” allowed in C++?
- How should I write ISO C++ Standard conformant custom new and delete operators?
- How does delete[] know it’s an array?
- How do you ‘realloc’ in C++?
- Why would one replace default new and delete operators?
- overloading new/delete
- delete[] an array of objects
- When to use new and delete
- Why there is no placement delete expression in C++?
- Why doesn’t delete destroy anything?
- C++ delete – It deletes my objects but I can still access the data?
- In what cases do I use malloc and/or new?
- delete vs delete[] operators in C++
- Is it safe to delete a NULL pointer?
- Calling delete on variable allocated on the stack
- delete vs delete[] [duplicate]
- Why doesn’t delete set the pointer to NULL?
- placement new and delete
- Is it still safe to delete nullptr in c++0x?
- Is the pointer guaranteed to preserve its value after `delete` in C++?
- Deleting a pointer in C++
- What are uses of the C++ construct “placement new”?
- Does new[] call default constructor in C++?
- new() without delete() is Undefined Behavior or merely Memory Leak? [duplicate]
- What does “new int(100)” do?
- Must new always be followed by delete? [duplicate]
- Call destructor and then constructor (resetting an object)
- Will new operator return NULL? [duplicate]
- Calling delete on NULL pointers – C++03 vs C++11
- Is the whole object freed with a non-virtual destructor and a Base class pointer?