title: Freeing pointers in structs pointing to other structs
body: <p>Let's say I have some data structure in which structs have pointers to other structs, such as a linked list. Each element in the list would have a pointer to another element in the list</p>
  
  <pre><code>struct node{
    char* data;
    node* next;
  };
  </code></pre>
  
  <p>When freeing the memory allocated to this structure, I am aware I need to specifically free data first, as I have to allocate memory for it specifically. But what about next? It points to another node, and I believe freeing it would free the actual node next is pointing to.</p>
  
  <p>Is it enough to just free the entire node when cleaning up, or is there any way to free the pointer without freeing the struct it is pointing to?</p>