redefining a class pointer - memory leak?

This may be a simple question but I'm unsure of the answer. Suppose I have a class "DUMMY" which has two different constructors defined and I do the following:

1
2
3
DUMMY * mydummy;
mydummy = new DUMMY();
mydummy = new DUMMY("initial value");


This is the simplest example of my real problem that I could find. Does this cause a memory leak? It seems to work okay when I write a test program but I don't know if the second instantiation allocates additional memory or if the contents of the original allocation are just replaced nor do I know if

delete mydummy;

will free up all the allocated memory?

Any help will be appreciated.
Does this cause a memory leak?
Yes, you need as many delete as new.
The second one will allocate new memory.

I reckon it's a memory leak.
This is correct:
1
2
3
4
5
DUMMY * mydummy;
mydummy = new DUMMY();
delete mydummy;
mydummy = new DUMMY("initial value");
delete mydummy;
Topic archived. No new replies allowed.