diff options
Diffstat (limited to 'tests/libtest/lib503.c')
-rw-r--r-- | tests/libtest/lib503.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/tests/libtest/lib503.c b/tests/libtest/lib503.c index 11f1150c0..3e8f3dc55 100644 --- a/tests/libtest/lib503.c +++ b/tests/libtest/lib503.c @@ -29,7 +29,7 @@ int test(char *URL) { CURL *c; - CURLM *m; + CURLM *m = NULL; int res = 0; int running; char done = FALSE; @@ -49,12 +49,12 @@ int test(char *URL) return TEST_ERR_MAJOR_BAD; } - curl_easy_setopt(c, CURLOPT_PROXY, libtest_arg2); /* set in first.c */ - curl_easy_setopt(c, CURLOPT_URL, URL); - curl_easy_setopt(c, CURLOPT_USERPWD, "test:ing"); - curl_easy_setopt(c, CURLOPT_PROXYUSERPWD, "test:ing"); - curl_easy_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1L); - curl_easy_setopt(c, CURLOPT_HEADER, 1L); + test_setopt(c, CURLOPT_PROXY, libtest_arg2); /* set in first.c */ + test_setopt(c, CURLOPT_URL, URL); + test_setopt(c, CURLOPT_USERPWD, "test:ing"); + test_setopt(c, CURLOPT_PROXYUSERPWD, "test:ing"); + test_setopt(c, CURLOPT_HTTPPROXYTUNNEL, 1L); + test_setopt(c, CURLOPT_HEADER, 1L); if ((m = curl_multi_init()) == NULL) { fprintf(stderr, "curl_multi_init() failed\n"); @@ -139,9 +139,13 @@ int test(char *URL) res = TEST_ERR_RUNS_FOREVER; } - curl_multi_remove_handle(m, c); +test_cleanup: + + if(m) { + curl_multi_remove_handle(m, c); + curl_multi_cleanup(m); + } curl_easy_cleanup(c); - curl_multi_cleanup(m); curl_global_cleanup(); return res; |