aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest/lib1510.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2014-01-29 00:31:00 +0100
committerDan Fandrich <dan@coneharvesters.com>2014-01-29 00:40:33 +0100
commit9873fd5317615168a0871058e8fd4668adc199b5 (patch)
treefed96d371e0acbe8fc8663e9eced599862678f31 /tests/libtest/lib1510.c
parentd735d3e803bca23d782ab0791896a6b29fcd9eb2 (diff)
tests: make a few lib15?? tests pass the OOM torture tests
Diffstat (limited to 'tests/libtest/lib1510.c')
-rw-r--r--tests/libtest/lib1510.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/libtest/lib1510.c b/tests/libtest/lib1510.c
index 1bcf2165a..d19a7b5f0 100644
--- a/tests/libtest/lib1510.c
+++ b/tests/libtest/lib1510.c
@@ -36,7 +36,7 @@ int test(char *URL)
int i;
char target_url[256];
char dnsentry[256];
- struct curl_slist *slist = NULL;
+ struct curl_slist *slist = NULL, *slist2;
char *port = libtest_arg3;
char *address = libtest_arg2;
@@ -46,7 +46,12 @@ int test(char *URL)
for(i=0; i < NUM_URLS; i++) {
sprintf(dnsentry, "server%d.example.com:%s:%s", i + 1, port, address);
printf("%s\n", dnsentry);
- slist = curl_slist_append(slist, dnsentry);
+ slist2 = curl_slist_append(slist, dnsentry);
+ if(!slist2) {
+ fprintf(stderr, "curl_slist_append() failed\n");
+ goto test_cleanup;
+ }
+ slist = slist2;
}
start_test_timing();