<div dir="ltr">On Sun, Jun 28, 2015 at 8:49 PM, Peter Hutterer <span dir="ltr"><<a href="mailto:peter.hutterer@who-t.net" target="_blank">peter.hutterer@who-t.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
+       if (elm->next == NULL && elm->prev == NULL)<br>
+               return;<br>
+<br>
        elm->prev->next = elm->next;<br>
        elm->next->prev = elm->prev;<br>
        elm->next = NULL;<br></blockquote><div><br> You probably don't need to check both pointers, as the code will crash if only one of them is NULL.<br></div></div></div></div>