MT#59962 call_control: free cURL handle at the end

Don't retrieve the result code from an already-freed object.

Change-Id: Ief92d8529f634428b95fcfcfa702445275c6c74e
Warned-by: Coverity
mr13.3.1
Richard Fuchs 1 year ago
parent f19f652d63
commit 39cfdbe79b

@ -148,6 +148,9 @@ bool RestParams::get(const string &url, string &data)
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, "REST-in-peace/0.1");
CURLcode res = curl_easy_perform(curl_handle);
long code = 0;
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &code);
curl_easy_cleanup(curl_handle);
if (res != 0) {
@ -156,8 +159,6 @@ bool RestParams::get(const string &url, string &data)
return false;
}
long code = 0;
curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &code);
if ((code < 200) || (code > 299)) {
DBG("non-ok response code when downloading data: %ld\n", code);
return false;

Loading…
Cancel
Save