Skip to content

Commit

Permalink
Fix CURLINFO_COOKIELIST leak
Browse files Browse the repository at this point in the history
  • Loading branch information
nikic committed Jun 25, 2019
1 parent 8277ace commit 8757f30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ext/curl/interface.c
Expand Up @@ -3432,11 +3432,12 @@ PHP_FUNCTION(curl_getinfo)
case CURLINFO_SLIST:
{
struct curl_slist *slist;
array_init(return_value);
if (curl_easy_getinfo(ch->cp, option, &slist) == CURLE_OK) {
while (slist) {
add_next_index_string(return_value, slist->data);
slist = slist->next;
struct curl_slist *current = slist;
array_init(return_value);
while (current) {
add_next_index_string(return_value, current->data);
current = current->next;
}
curl_slist_free_all(slist);
} else {
Expand Down

0 comments on commit 8757f30

Please sign in to comment.