title: Is using a function that assigns to a null pointer using the null pointer as an argument valid in C?
body: <p>I'm trying to insert into the front of a linked list and also return an allocated head for when head is NULL, but it seems to only work in the event that head is not NULL.</p>
  
  <p>essentially, if</p>
  
  <pre><code>node* x = NULL;
  </code></pre>
  
  <p>is</p>
  
  <pre><code>x = addfront(x, 3)
  </code></pre>
  
  <p>valid?</p>