diff --git a/src/klist.c b/src/klist.c index ab6b40b0..65e30448 100644 --- a/src/klist.c +++ b/src/klist.c @@ -205,6 +205,11 @@ void _k_add_head(K_LIST *list, K_ITEM *item, KLIST_FFL_ARGS) list->name, __func__, item->name, KLIST_FFL_PASS); } + if (item->prev || item->next) { + quithere(1, "%s() added item %s still linked" KLIST_FFL, + __func__, item->name, KLIST_FFL_PASS); + } + item->prev = NULL; item->next = list->head; if (list->head) @@ -241,6 +246,11 @@ void _k_add_tail(K_LIST *list, K_ITEM *item, KLIST_FFL_ARGS) list->name, __func__, KLIST_FFL_PASS); } + if (item->prev || item->next) { + quithere(1, "%s() added item %s still linked" KLIST_FFL, + __func__, item->name, KLIST_FFL_PASS); + } + item->prev = list->tail; item->next = NULL; if (list->tail)