diff options
Diffstat (limited to 'lib/list/list.c')
| -rw-r--r-- | lib/list/list.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/list/list.c b/lib/list/list.c index 753fdb1..8064da4 100644 --- a/lib/list/list.c +++ b/lib/list/list.c @@ -28,6 +28,20 @@ list_t *from_array(void **array, u64 size) } +void free_list(list_t *list) +{ + list_node_t *node = list->first; + list_node_t *next; + free(list); + + while (node) { + next = node->next; + free(node); + node = next; + } +} + + void list_append(list_t *list, void *value) { list_node_t *node = __new_list_node(value); |