aboutsummaryrefslogtreecommitdiff
path: root/lib/llist.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/llist.c')
-rw-r--r--lib/llist.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/llist.c b/lib/llist.c
index 9e38f6766..7ffdb1043 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -159,10 +159,10 @@ Curl_llist_count(curl_llist *list)
void
Curl_llist_destroy(curl_llist *list, void *user)
{
- while (list->size > 0) {
- Curl_llist_remove(list, CURL_LLIST_TAIL(list), user);
- }
+ if(list) {
+ while (list->size > 0)
+ Curl_llist_remove(list, CURL_LLIST_TAIL(list), user);
- free(list);
- list = NULL;
+ free(list);
+ }
}