title: MEMB memory allocation in Contiki
body: <p>In Contiki I declared a linked list like this:</p>
  
  <pre><code>MEMB(recv_memb, struct record, MAX_RECORD);
  LIST(recv_list);
  </code></pre>
  
  <p>After using the linked list I free the allocated memory like this:</p>
  
  <pre><code>for(n = list_head(recv_list); n != NULL; n = n-&gt;next)
  {     
      list_remove(recv_list,n); 
      memb_free(&amp;recv_memb,n); 
  }
  </code></pre>
  
  <p>but after reaching the MAX_RECORD the node restarts, How do I free the memory for another 30 records?</p>
  
  <p>I'm simulating a networking scenario in Contiki Cooja simulator and the code is a combination of Contiki programming and C.</p>