Index: list/list.c =================================================================== --- list/list.c (revision 17771) +++ list/list.c (revision 17772) @@ -77,3 +77,13 @@ len++; return len; } + +void LST(free)(LST(node_t) *list) +{ + LST(node_t) *node, *next_node; + if (list == NULL) + return NULL; + for (node = list, next_node = node->next; next_node != NULL; node = next_node, next_node = next_node->next) + free(node); + free(node); +} Index: list/list.h =================================================================== --- list/list.h (revision 17771) +++ list/list.h (revision 17772) @@ -11,3 +11,4 @@ LST(node_t) *LST(remove)(LST(node_t) *list, LST(node_t) *node); LST(node_t) *LST(remove_item)(LST(node_t) *list, LST_ITEM_T *item); size_t LST(length)(LST(node_t) *list); +void LST(free)(LST(node_t) *list);