title: What is the issue with double free()?
body: <p>I've been seeing quite a bit of erroneous code around the web and in my Advanced C class (such as the code below). While I understand that it's obviously bad coding practice, I'm having a difficult time as to what it does that's so bad other than waste CPU cycles. From my understanding so far, if a pointer allocation is not located in the "malloc table" (for lack of a better word), it is usually ignored. I'd appreciate if someone here could provide me with a better understanding as to why this is bad and (other than the fact that it's a silly thing to do) and the consequences of it are.</p>
  
  <pre><code>char* ptr = malloc(1);
  
  ...
  
  free(ptr);
  ...
  free(ptr);
  </code></pre>