diff options
author | Yang Tse <yangsita@gmail.com> | 2010-02-05 18:07:19 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2010-02-05 18:07:19 +0000 |
commit | cad9c3f55fad5da988144dc83ad76a8544a071a2 (patch) | |
tree | 9231f49bc11dfdb69b4cac9af3b1dd473d1507ad /tests/libtest/lib536.c | |
parent | 12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff) |
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib536.c')
-rw-r--r-- | tests/libtest/lib536.c | 13 |
1 files changed, 8 insertions, 5 deletions
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(); |