- Unchecked return value from library
Change-Id: Ifcb2672f3545dcc1adef9b942e80ee298c1c3c9c
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
return -1;
}
- curl_easy_setopt(curl.get(), CURLOPT_URL, addr.c_str());
+ CURLcode res = curl_easy_setopt(curl.get(), CURLOPT_URL, addr.c_str());
+ if (res != CURLE_OK) {
+ std::cout << "Failed to set option: "
+ << curl_easy_strerror(res) << std::endl;
+ return -1;
+ }
- CURLcode res = curl_easy_perform(curl.get());
+ res = curl_easy_perform(curl.get());
if (res != CURLE_OK) {
std::cout << "Failed to connect failed: "
<< curl_easy_strerror(res) << std::endl;