From 9873fd5317615168a0871058e8fd4668adc199b5 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 29 Jan 2014 00:31:00 +0100 Subject: tests: make a few lib15?? tests pass the OOM torture tests --- tests/libtest/lib1510.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/libtest/lib1510.c') 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(); -- cgit v1.2.3