aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib505.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-05-14 09:22:12 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-05-14 09:22:12 +0000
commite2e593a036c992f2d38e060e14b52c4a8862ca2d (patch)
tree69ce3c089381d03bd4f66792b2c994ddc0a13980 /tests/libtest/lib505.c
parent9ce0a7b49d4f004b7d55833a35feabbc8c27726f (diff)
clean up properly on failure to enable easier libcurl leak detection
Diffstat (limited to 'tests/libtest/lib505.c')
-rw-r--r--tests/libtest/lib505.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/libtest/lib505.c b/tests/libtest/lib505.c
index 131df7856..62c7b6880 100644
--- a/tests/libtest/lib505.c
+++ b/tests/libtest/lib505.c
@@ -72,9 +72,14 @@ int test(char *URL)
/* get a curl handle */
curl = curl_easy_init();
if(curl) {
+ struct curl_slist *hl;
/* build a list of commands to pass to libcurl */
- headerlist = curl_slist_append(headerlist, buf_1);
- headerlist = curl_slist_append(headerlist, buf_2);
+ hl = curl_slist_append(headerlist, buf_1);
+ if(hl) {
+ headerlist = curl_slist_append(hl, buf_2);
+ if(hl)
+ headerlist = hl;
+ }
/* enable uploading */
curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;