title: C Linked-list Destroy Function
body: <p>I am trying to learn C, and as many people, I have been a little stuck with pointers. Anyways, I made a recursive function that destroys my linked list, but as I have debugged, when I am back from the function the head of the list is not null as it should be, so I'm guessing it's some basic misunderstanding with pointers. Here's the function:</p>
  
  <pre><code>void destroy(struct node *n) {
     if (!n) return;
     destroy(n-&gt;next);
     free(n);
     n = NULL;
  }
  </code></pre>