summaryrefslogtreecommitdiff
path: root/tests/libtest/lib505.c
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2010-02-05 18:07:19 +0000
committerYang Tse <yangsita@gmail.com>2010-02-05 18:07:19 +0000
commitcad9c3f55fad5da988144dc83ad76a8544a071a2 (patch)
tree9231f49bc11dfdb69b4cac9af3b1dd473d1507ad /tests/libtest/lib505.c
parent12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff)
downloadcurl-cad9c3f55fad5da988144dc83ad76a8544a071a2.tar.gz
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib505.c')
-rw-r--r--tests/libtest/lib505.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c
index 2d2858af1..b1c679990 100644
--- a/tests/libtest/lib505.c
+++ b/tests/libtest/lib505.c
@@ -117,27 +117,29 @@ int test(char *URL)
headerlist = hl;
/* enable uploading */
- curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L);
+ test_setopt(curl, CURLOPT_UPLOAD, 1L);
/* enable verbose */
- curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+ test_setopt(curl, CURLOPT_VERBOSE, 1L);
/* specify target */
- curl_easy_setopt(curl,CURLOPT_URL, URL);
+ test_setopt(curl,CURLOPT_URL, URL);
/* pass in that last of FTP commands to run after the transfer */
- curl_easy_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
+ test_setopt(curl, CURLOPT_POSTQUOTE, headerlist);
/* now specify which file to upload */
- curl_easy_setopt(curl, CURLOPT_INFILE, hd_src);
+ test_setopt(curl, CURLOPT_INFILE, hd_src);
/* and give the size of the upload (optional) */
- curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE,
+ test_setopt(curl, CURLOPT_INFILESIZE_LARGE,
(curl_off_t)file_info.st_size);
/* Now run off and do what you've been told! */
res = curl_easy_perform(curl);
+test_cleanup:
+
/* clean up the FTP commands list */
curl_slist_free_all(headerlist);