Skip to content

Commit

Permalink
Curl_llist_destroy() checks the input for non-NULL
Browse files Browse the repository at this point in the history
  • Loading branch information
bagder committed Aug 14, 2003
1 parent 68a4aa6 commit 4281470
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/llist.c
Expand Up @@ -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);
}
}

0 comments on commit 4281470

Please sign in to comment.