From cad9c3f55fad5da988144dc83ad76a8544a071a2 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Fri, 5 Feb 2010 18:07:19 +0000 Subject: Addes OOM handling for curl_easy_setopt() calls in test --- tests/libtest/lib536.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tests/libtest/lib536.c') diff --git a/tests/libtest/lib536.c b/tests/libtest/lib536.c index 016b7e922..06d863ca9 100644 --- a/tests/libtest/lib536.c +++ b/tests/libtest/lib536.c @@ -93,9 +93,9 @@ int test(char *URL) curl_multi_setopt(multi, CURLMOPT_PIPELINING, 1L); - curl_easy_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(easy, CURLOPT_URL, URL); + test_setopt(easy, CURLOPT_WRITEFUNCTION, fwrite); + test_setopt(easy, CURLOPT_FAILONERROR, 1L); + test_setopt(easy, CURLOPT_URL, URL); if (curl_multi_add_handle(multi, easy) != CURLM_OK) { printf("curl_multi_add_handle() failed\n"); @@ -108,8 +108,8 @@ int test(char *URL) } curl_easy_reset(easy); - curl_easy_setopt(easy, CURLOPT_FAILONERROR, 1L); - curl_easy_setopt(easy, CURLOPT_URL, libtest_arg2); + test_setopt(easy, CURLOPT_FAILONERROR, 1L); + test_setopt(easy, CURLOPT_URL, libtest_arg2); if (curl_multi_add_handle(multi, easy) != CURLM_OK) { printf("curl_multi_add_handle() 2 failed\n"); @@ -120,6 +120,9 @@ int test(char *URL) curl_multi_remove_handle(multi, easy); } + +test_cleanup: + curl_easy_cleanup(easy); curl_multi_cleanup(multi); curl_global_cleanup(); -- cgit v1.2.3