diff --git a/src/util/list.h b/src/util/list.h index 9de8a2842bc..0e71a66a7d5 100644 --- a/src/util/list.h +++ b/src/util/list.h @@ -124,7 +124,7 @@ static inline bool list_is_linked(const struct list_head *list) */ static inline bool list_is_singular(const struct list_head *list) { - return list_is_linked(list) && list->next != list && list->next->next == list; + return list_is_linked(list) && !list_is_empty(list) && list->next->next == list; } static inline unsigned list_length(const struct list_head *list)