diff options
-rw-r--r-- | tests/libtest/lib1908.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/libtest/lib1908.c b/tests/libtest/lib1908.c index 1e4a24974..bacbc9710 100644 --- a/tests/libtest/lib1908.c +++ b/tests/libtest/lib1908.c @@ -27,20 +27,21 @@ int test(char *URL) { - CURLcode ret; + CURLcode ret = CURLE_OK; CURL *hnd; start_test_timing(); curl_global_init(CURL_GLOBAL_ALL); hnd = curl_easy_init(); - curl_easy_setopt(hnd, CURLOPT_URL, URL); - curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); - curl_easy_setopt(hnd, CURLOPT_ALTSVC, "log/altsvc-1908"); - ret = curl_easy_perform(hnd); - curl_easy_reset(hnd); - curl_easy_cleanup(hnd); - + if(hnd) { + curl_easy_setopt(hnd, CURLOPT_URL, URL); + curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L); + curl_easy_setopt(hnd, CURLOPT_ALTSVC, "log/altsvc-1908"); + ret = curl_easy_perform(hnd); + curl_easy_reset(hnd); + curl_easy_cleanup(hnd); + } curl_global_cleanup(); return (int)ret; } |