summaryrefslogtreecommitdiff
path: root/list.c
diff options
context:
space:
mode:
Diffstat (limited to 'list.c')
-rw-r--r--list.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/list.c b/list.c
index 6aacfbd..2b8f34a 100644
--- a/list.c
+++ b/list.c
@@ -13,6 +13,9 @@ struct list *list_create() {
/* frees all memory associated with the list */
void list_destroy(struct list *list) {
struct list_node *node, *next;
+
+ if (!list)
+ return;
for (node = list->first; node; node = next) {
free(node->data);