title: Trying to use free() to understand how it works
body: <p>To understand the usage of free in the C programming language I tried running this code on Ubuntu, but on running the EXE file I am receiving a SIGABRT error. Why is the program not exiting normally?</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;stdlib.h&gt;
  
  int main()
  {
     int ret;
     int *ptr;
     ptr = (int *)malloc(sizeof(int)*10);
     free(ptr);
     ptr = &amp;ret;
     free(ptr);
     return 0;
  }
  </code></pre>