C++ - function that returns object
<pre><code>// Assume class definition for Cat is here.

Cat makeCat() {
    Cat lady = new Cat("fluffy");
    return lady;
}

int main (...) {
    Cat molly = makeCat();
    molly-&gt;eatFood(); 
    return 0;
}
</code></pre>

<p>Will there be a <strong>"use after free"</strong> error on <code>molly-&gt;eatFood()</code>?</p>
