rc/utils_llist.c: Fix a bug in llist_prepend.
[collectd.git] / src / utils_llist.c
index d8694e3..d5db9dc 100644 (file)
@@ -110,6 +110,9 @@ void llist_prepend (llist_t *l, llentry_t *e)
 {
        e->next = l->head;
        l->head = e;
+
+       if (l->tail == NULL)
+               l->tail = e;
 }
 
 void llist_remove (llist_t *l, llentry_t *e)