aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib564.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/libtest/lib564.c')
-rw-r--r--tests/libtest/lib564.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/tests/libtest/lib564.c b/tests/libtest/lib564.c
index e04a5aba1..827e08dda 100644
--- a/tests/libtest/lib564.c
+++ b/tests/libtest/lib564.c
@@ -26,7 +26,7 @@ int test(char *URL)
CURL *curl;
int running;
char done=FALSE;
- CURLM *m;
+ CURLM *m = NULL;
struct timeval ml_start;
struct timeval mp_start;
char ml_timedout = FALSE;
@@ -43,10 +43,10 @@ int test(char *URL)
return TEST_ERR_MAJOR_BAD;
}
- curl_easy_setopt(curl, CURLOPT_URL, URL);
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);
- curl_easy_setopt(curl, CURLOPT_PROXY, libtest_arg2);
- curl_easy_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_VERBOSE, 1);
+ test_setopt(curl, CURLOPT_PROXY, libtest_arg2);
+ test_setopt(curl, CURLOPT_PROXYTYPE, CURLPROXY_SOCKS4);
if ((m = curl_multi_init()) == NULL) {
fprintf(stderr, "curl_multi_init() failed\n");
@@ -133,8 +133,11 @@ int test(char *URL)
res = TEST_ERR_RUNS_FOREVER;
}
+test_cleanup:
+
curl_easy_cleanup(curl);
- curl_multi_cleanup(m);
+ if(m)
+ curl_multi_cleanup(m);
curl_global_cleanup();
return res;