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/lib544.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/libtest/lib544.c') diff --git a/tests/libtest/lib544.c b/tests/libtest/lib544.c index b17e64af2..3229fdad3 100644 --- a/tests/libtest/lib544.c +++ b/tests/libtest/lib544.c @@ -40,16 +40,16 @@ int test(char *URL) } /* First set the URL that is about to receive our POST. */ - curl_easy_setopt(curl, CURLOPT_URL, URL); + test_setopt(curl, CURLOPT_URL, URL); #ifdef LIB545 - curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1); + test_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) sizeof teststring - 1); #endif - curl_easy_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring); + test_setopt(curl, CURLOPT_COPYPOSTFIELDS, teststring); - curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */ - curl_easy_setopt(curl, CURLOPT_HEADER, 1L); /* include header */ + test_setopt(curl, CURLOPT_VERBOSE, 1L); /* show verbose for debug */ + test_setopt(curl, CURLOPT_HEADER, 1L); /* include header */ /* Update the original data to detect non-copy. */ strcpy(teststring, "FAIL"); @@ -57,6 +57,8 @@ int test(char *URL) /* Now, this is a POST request with binary 0 embedded in POST data. */ res = curl_easy_perform(curl); +test_cleanup: + /* always cleanup */ curl_easy_cleanup(curl); curl_global_cleanup(); -- cgit v1.2.1