src/utils_llist.c: Handle unlikely corner case.
authorFlorian Forster <octo@collectd.org>
Wed, 17 Jun 2015 07:09:17 +0000 (09:09 +0200)
committerFlorian Forster <octo@collectd.org>
Wed, 17 Jun 2015 07:09:20 +0000 (09:09 +0200)
commit707fa6cb057b53846aaa27a505fe05226612ecd3
tree84e2ca21a8a210e8b4e9e79eda8bbbf394d7b34e
parent86ef26818f3a1af5afb4842e9c97c34ffe98bafa
src/utils_llist.c: Handle unlikely corner case.

This handles the following (unlikely) case:
    (l->head == NULL) && (e == NULL)

In this case, the following code will dereference a NULL pointer:
    if (l->head == e)
      l->head = e->next;
src/utils_llist.c