 <p>I agree with the other commenters that this question needs more information about the initial conditions of your problem before it can be properly answered. However, a scenario that causes your code to fail comes to mind immediately.</p> <p>Suppose that plist is a circularly linked list with three elements: A &lt;-> B &lt;-> C &lt;-> A, and plist points to A.</p> <p>When your code runs, it will: deallocate A, advance to B, deallocate B, advance to C, deallocate C and then advance to the <em>freed</em> memory that was A. Now your code blows up. (or runs forever)</p> <p>Since it is a doubly linked list, you should use your previous links to null out your next links before deallocating. And for good measure, null out your prev links as well.</p> <pre><code>temp_nlist = n_list-&gt;next; temp_nlist-&gt;prev = NULL; if (n_list-&gt;prev != NULL) n_list-&gt;prev-&gt;next = NULL; free(n_list); n_list = temp_nlist; </code></pre>