Memory issue with overload operator
<p>Suppose one has this code:</p>

<pre><code>class MyClass {
public:
    MyClass(int foo) : foo(foo){}

private:
    int foo;

//overloaded operator +
public:
    MyClass operator+(MyClass &amp;mc){
        MyClass c(mc.foo + foo);
        return c;
    }
};

int main(int argc, char* argv[]){
    MyClass c1(10);
    MyClass c2(12);

    c2 = c1 + c2;

    return EXIT_SUCCESS;
}
</code></pre>

<p>Where the operator + is overload such that it does not modify the object but create a new object and return it.</p>

<p>When <code>c2 = c1 + c2</code> is called, <code>c2</code> is bound with the new object, but the previous object bound with <code>c2</code> is not (or at least it seems to me) freed. I'm i right?</p>

<p>Since C++ has no a Garbage Collector, is this a problem?</p>

<p>Am I missing something?</p>
