mirror of
https://github.com/curl/curl.git
synced 2024-11-21 01:16:58 +08:00
Curl_llist_destroy() checks the input for non-NULL
This commit is contained in:
parent
68a4aa6773
commit
4281470fca
10
lib/llist.c
10
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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user