title: Deleting memory in C
body: <p>How do I delete memory in C?</p>
  
  <p>For example, I have:</p>
  
  <pre><code>#include&lt;stdlib.h&gt;
  #include&lt;stdio.h&gt;
  
  struct list_el {
     int val;
     struct list_el * next;
  };
  
  typedef struct list_el item;
  
  void main() {
     item * curr, * head;
     int i;
  
     head = NULL;
  
     for(i=1;i&lt;=10;i++) {
        curr = (item *)malloc(sizeof(item));
        curr-&gt;val = i;
        curr-&gt;next  = head;
        head = curr;
     }
  
     curr = head;
  
     while(curr) {
        printf("%d\n", curr-&gt;val);
        curr = curr-&gt;next ;
     }
  }
  </code></pre>
  
  <p>After I created the items 1 - 10, how do I delete it and make sure it doesn't exist in memory?</p>