Remove several calls to free (#2308)

This commit is contained in:
Andrew Gaul
2023-09-06 23:50:33 +09:00
committed by GitHub
parent 5f38301861
commit fa3a472c6b
2 changed files with 5 additions and 17 deletions

View File

@ -71,6 +71,7 @@ struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* k
}
struct curl_slist* new_item;
// Must use malloc since curl_slist_free_all calls free.
if(nullptr == (new_item = static_cast<struct curl_slist*>(malloc(sizeof(*new_item))))){
free(data);
return list;