aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib567.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/lib567.c
parent12d01bc5f72c4c0f9aabfa45628d9c4702491fb0 (diff)
Addes OOM handling for curl_easy_setopt() calls in test
Diffstat (limited to 'tests/libtest/lib567.c')
-rw-r--r--tests/libtest/lib567.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/tests/libtest/lib567.c b/tests/libtest/lib567.c
index e04873b11..feae2cecf 100644
--- a/tests/libtest/lib567.c
+++ b/tests/libtest/lib567.c
@@ -32,20 +32,23 @@ int test(char *URL)
}
/* Dump data to stdout for protocol verification */
- curl_easy_setopt(curl, CURLOPT_HEADERDATA, stdout);
- curl_easy_setopt(curl, CURLOPT_WRITEDATA, stdout);
+ test_setopt(curl, CURLOPT_HEADERDATA, stdout);
+ test_setopt(curl, CURLOPT_WRITEDATA, stdout);
- curl_easy_setopt(curl, CURLOPT_URL, URL);
- curl_easy_setopt(curl, CURLOPT_RTSP_STREAM_URI, URL);
- curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
- curl_easy_setopt(curl, CURLOPT_USERAGENT, "test567");
+ test_setopt(curl, CURLOPT_URL, URL);
+ test_setopt(curl, CURLOPT_RTSP_STREAM_URI, URL);
+ test_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_OPTIONS);
+ test_setopt(curl, CURLOPT_USERAGENT, "test567");
custom_headers = curl_slist_append(custom_headers, "Test-Number: 567");
- curl_easy_setopt(curl, CURLOPT_RTSPHEADER, custom_headers);
+ test_setopt(curl, CURLOPT_RTSPHEADER, custom_headers);
res = curl_easy_perform(curl);
- curl_slist_free_all(custom_headers);
+test_cleanup:
+
+ if(custom_headers)
+ curl_slist_free_all(custom_headers);
curl_easy_cleanup(curl);
curl_global_cleanup();