title: Delete Derived Class with Stack Pointer?
body: <p>So stack memory cannot be manually be freed up via delete, because this somehow induces UB. But when creating a derived class object, the "new"-keyword is involved. Say for example:</p>
  
  <pre><code>void some_function(){
      Base* base;
      base = new Derived;
  }
  </code></pre>
  
  <p>As "new" is involved, is base = new Derived now located on the heap? And if so, does the memory where it is located, need to be freed up manually again? Or is it located on the stack and the memory will be freed up after the program terminates anyway?</p>