diff options
-rw-r--r-- | lib/llist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/llist.c b/lib/llist.c index e1e6a564..45fe014d 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -109,7 +109,7 @@ void *dlist_terminate(void *list) { struct double_list *end = list; - if (!list) return 0; + if (!end || !end->prev) return 0; end = end->prev; end->next->prev = 0; |