diff options
Diffstat (limited to 'tests/libtest/lib502.c')
-rw-r--r-- | tests/libtest/lib502.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tests/libtest/lib502.c b/tests/libtest/lib502.c index 85c300fbe..0a0a819b0 100644 --- a/tests/libtest/lib502.c +++ b/tests/libtest/lib502.c @@ -23,7 +23,7 @@ int test(char *URL) { CURL *c; - CURLM *m; + CURLM *m = NULL; int res = 0; int running=1; struct timeval mp_start; @@ -40,7 +40,7 @@ int test(char *URL) return TEST_ERR_MAJOR_BAD; } - curl_easy_setopt(c, CURLOPT_URL, URL); + test_setopt(c, CURLOPT_URL, URL); if ((m = curl_multi_init()) == NULL) { fprintf(stderr, "curl_multi_init() failed\n"); @@ -81,9 +81,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; |