title: Segfaults and Memory leaks
body: <p>My question has two parts:</p>
  
  <ul>
  <li>Is it possible that, if a segfault occurs after allocating memory but before freeing it, this leaks memory (that is, the memory is never freed resulting in a memory leak)? </li>
  <li>If so, is there any way to ensure allocated memory is cleaned up in the event of a segfault?</li>
  </ul>
  
  <p>I've been reading about memory manamgement in C++ but was unable to find anything about my specific question.</p>