]> git.meshlink.io Git - meshlink/blobdiff - src/list.c
Add assert() calls to the library.
[meshlink] / src / list.c
index c75cf14624d82c988613cf5beb8f7f1e05071c3c..8a48360481d2f8f0a3431812d036520ab9311553 100644 (file)
@@ -186,8 +186,11 @@ void *list_get_tail(list_t *list) {
 void list_delete_list(list_t *list) {
        for(list_node_t *node = list->head, *next; next = node ? node->next : NULL, node; node = next) {
                list_free_node(list, node);
+               list->count--;
        }
 
+       assert(!list->count);
+
        list_free(list);
 }