diff options
author | Daniel Stenberg <daniel@haxx.se> | 2004-05-14 09:22:12 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2004-05-14 09:22:12 +0000 |
commit | e2e593a036c992f2d38e060e14b52c4a8862ca2d (patch) | |
tree | 69ce3c089381d03bd4f66792b2c994ddc0a13980 /tests/libtest/lib505.c | |
parent | 9ce0a7b49d4f004b7d55833a35feabbc8c27726f (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.c | 9 |
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) ; |