Curl_llist_destroy() checks the input for non-NULL

This commit is contained in:
Daniel Stenberg 2003-08-14 15:06:08 +00:00
parent 68a4aa6773
commit 4281470fca
1 changed files with 5 additions and 5 deletions

View File

@ -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);
}
}