aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib505.c
diff options
context:
space:
mode:
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) ;