[PATCH libinput 1/5] util: allow list_remove() on a NULL node

Bill Spitzak spitzak at gmail.com
Mon Jun 29 12:37:26 PDT 2015


On Sun, Jun 28, 2015 at 8:49 PM, Peter Hutterer <peter.hutterer at who-t.net>
wrote:

>
> +       if (elm->next == NULL && elm->prev == NULL)
> +               return;
> +
>         elm->prev->next = elm->next;
>         elm->next->prev = elm->prev;
>         elm->next = NULL;
>

 You probably don't need to check both pointers, as the code will crash if
only one of them is NULL.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/wayland-devel/attachments/20150629/b790b137/attachment.html>


More information about the wayland-devel mailing list