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:
parent
9c324d1eb9
commit
ac894128c6
2
yt.cpp
2
yt.cpp
|
@ -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_setopt(curl, CURLOPT_VERBOSE, 1L);
|
||||||
curl_easy_perform(curl);
|
curl_easy_perform(curl);
|
||||||
|
curl_free(real_url);
|
||||||
|
|
||||||
data.push_back(0);
|
data.push_back(0);
|
||||||
|
|
||||||
int http_response = 0;
|
int http_response = 0;
|
||||||
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_response);
|
curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &http_response);
|
||||||
|
|
||||||
curl_free(real_url);
|
|
||||||
curl_url_cleanup(u);
|
curl_url_cleanup(u);
|
||||||
curl_easy_cleanup(curl);
|
curl_easy_cleanup(curl);
|
||||||
if(headers)
|
if(headers)
|
||||||
|
|
Loading…
Reference in New Issue