title: Linked list prints segmentation fault
body: <p>I am learning about linked lists in c and when i try printing the head's base_pri in main() it just gives me a segmentation fault. 
  Here is my code: </p>
  
  <pre><code>#include&lt;stdlib.h&gt;
  
  typedef struct iorb {
  int base_pri;
  struct iorb *link;
  } IORB;
  
  IORB *head = NULL;
  void makeList(IORB *h, int s);
  
  int main(){
    makeList(head, 15);
  
    printf("%d\n", head-&gt;base_pri);
  
      return 0;
  }
  
   void makeList(IORB *h, int s){
        while(s &gt; 0){
          IORB *temp = (IORB*)malloc(sizeof(IORB));
          temp-&gt;base_pri = (rand() % 20);
          temp-&gt;link = h;
          h = temp;
          s--;
      }
   }
  </code></pre>
  
  <p>Any advice would be appreciated. </p>