From 3bc394ffb90b5eaedd6418d373e0312f2bcb5396 Mon Sep 17 00:00:00 2001 From: kanoi Date: Mon, 20 Apr 2015 18:33:05 +1000 Subject: [PATCH] ckdb - abort code that adds an item already in a list/store --- src/klist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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)