int main() {
Employee *e = new Employee();
delete e;
delete e;
...
delete e;
return 0;
}
If you are worried this might happen in your apps, either stop using raw pointers completely, so that you don't need delete (eg switch over to shared_ptr) or always set pointers to NULL (or 0, or better still nullptr) after you delete them. Calling delete on a null pointer is guaranteed to do nothing.