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/lib505.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'tests/libtest/lib505.c') 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); -- cgit v1.2.1