aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2003-08-14 15:06:08 +0000
committerDaniel Stenberg <daniel@haxx.se>2003-08-14 15:06:08 +0000
commit4281470fca67dd51ffba1799d303e2eedaa1efa8 (patch)
tree731c29891643aa42ea10e33f666e157175f42772
parent68a4aa6773bffce907741bbf70962c932c1ab599 (diff)
Curl_llist_destroy() checks the input for non-NULL
-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);
+ }
}