aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib543.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/lib543.c
parent12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff)
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib543.c')
-rw-r--r--tests/libtest/lib543.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/tests/libtest/lib543.c b/tests/libtest/lib543.c
index 0f97bab8d..88387a198 100644
--- a/tests/libtest/lib543.c
+++ b/tests/libtest/lib543.c
@@ -20,11 +20,20 @@ int test(char *URL)
0xe0, 0xd8, 0x7c, 0x20, 0xb7, 0xef, 0x53, 0x29, 0xfa,
0x1d, 0x57, 0xe1};
- CURL* easy = curl_easy_init();
- int asize = (int)sizeof(a);
- char* s = curl_easy_escape(easy, (char*)a, asize);
+ CURL *easy;
+ int asize;
+ char *s;
(void)URL;
+ if ((easy = curl_easy_init()) == NULL) {
+ fprintf(stderr, "curl_easy_init() failed\n");
+ return TEST_ERR_MAJOR_BAD;
+ }
+
+ asize = (int)sizeof(a);
+
+ s = curl_easy_escape(easy, (char*)a, asize);
+
printf("%s\n", s);
curl_free(s);