diff options
author | Daniel Stenberg <daniel@haxx.se> | 2003-08-14 15:06:08 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2003-08-14 15:06:08 +0000 |
commit | 4281470fca67dd51ffba1799d303e2eedaa1efa8 (patch) | |
tree | 731c29891643aa42ea10e33f666e157175f42772 /lib/llist.c | |
parent | 68a4aa6773bffce907741bbf70962c932c1ab599 (diff) | |
download | curl-4281470fca67dd51ffba1799d303e2eedaa1efa8.tar.gz |
Curl_llist_destroy() checks the input for non-NULL
Diffstat (limited to 'lib/llist.c')
-rw-r--r-- | lib/llist.c | 10 |
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); + } } |