Fix coverity defect 28/225028/1 accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix accepted/tizen/6.0/unified/20201030.115309 accepted/tizen/6.0/unified/hotfix/20201103.004108 accepted/tizen/6.5/unified/20211028.121524 accepted/tizen/7.0/unified/20221110.062552 accepted/tizen/7.0/unified/hotfix/20221116.105639 accepted/tizen/unified/20200218.145934 submit/tizen/20200217.042237 submit/tizen_6.0/20201029.205104 submit/tizen_6.0_hotfix/20201102.192504 submit/tizen_6.0_hotfix/20201103.114804 submit/tizen_6.5/20211028.162401 tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release
authorSangwan Kwon <sangwan.kwon@samsung.com>
Mon, 17 Feb 2020 01:04:53 +0000 (10:04 +0900)
committerSangwan Kwon <sangwan.kwon@samsung.com>
Mon, 17 Feb 2020 01:05:43 +0000 (10:05 +0900)
- Unchecked return value from library

Change-Id: Ifcb2672f3545dcc1adef9b942e80ee298c1c3c9c
Signed-off-by: Sangwan Kwon <sangwan.kwon@samsung.com>
tests/test-util.cpp

index 83d2ecf..11ddd33 100644 (file)
@@ -80,9 +80,14 @@ int connectSSL(const std::string &addr)
                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;