From 4281470fca67dd51ffba1799d303e2eedaa1efa8 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 14 Aug 2003 15:06:08 +0000 Subject: [PATCH] Curl_llist_destroy() checks the input for non-NULL --- lib/llist.c | 10 +++++----- 1 file 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); + } }