diff options
author | venaas <venaas> | 2008-08-27 12:17:34 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-08-27 12:17:34 +0000 |
commit | 0e6647a3d9bae452a5db41d9786a0c2cc1c43338 (patch) | |
tree | bb72f3b2fdff1fda3b751bbf5c5734da6624642f | |
parent | a44302539f584d2f53caf84122f565f069d151c4 (diff) |
minor fix in list.c
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/branches/release-1.1@360 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | list.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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); @@ -47,7 +50,7 @@ void *list_shift(struct list *list) { struct list_node *node; void *data; - if (!list->first) + if (!list || !list->first) return NULL; node = list->first; |