title: Memory leak in removehead function
body: <p>Hey everyone I am getting a memory leak in my remove head function. I think it could be that im not freeing the head but I can't seem to find the correct place to put it. I was thinking right above the line that says L->head = L->head->next;</p>
  
  <pre><code>data_t * removehead(list_t *L) {
    data_t *temp = NULL;
  }
  if (L-&gt;head != NULL) {
    temp = L-&gt;head-&gt;data_ptr;
    L-&gt;head = L-&gt;head-&gt;next;
    L-&gt;size--;
  }
  return temp;
  }
  </code></pre>
  
  <p>Any thoughts?</p>