I want to implemet linked list in c++ ,while adding new node I dynamicly allocate it, if some allocation fails I would like my program to stop the execution.
After the "new Node" fails the exception is thrown so do I have to call the destructor explicitly in the exception handler. how can I deal with this situation in order to prevent memory leak?