Free data from cURL URL buffer as early as possible

Freeing it where it was causes a segmentation fault for some reason
This commit is contained in:
Daniel Schulte 2020-11-23 00:03:59 +01:00
parent 9c324d1eb9
commit ac894128c6
1 changed files with 1 additions and 1 deletions

2
yt.cpp
View File

@ -47,13 +47,13 @@ static json api_request(const std::string &url, std::map<std::string, std::strin
//curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_perform(curl);
curl_free(real_url);
data.push_back(0);
int http_response = 0;
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_response);
curl_free(real_url);
curl_url_cleanup(u);
curl_easy_cleanup(curl);
if(headers)