aboutsummaryrefslogtreecommitdiff
path: root/tests/libtest
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-04-12 13:09:04 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-04-12 16:21:24 +0200
commit2b126cd7083ddf1308ebc447cabd1983b16a99fa (patch)
tree4318634139c6a12f1deee620db909c9255be7e8b /tests/libtest
parent462d8378eace6fb74b0f34b87fc9babf55d23bea (diff)
duphandle: make sure CURLOPT_RESOLVE is duplicated fine too
Verified in test 1502 now Fixes #2485 Closes #2486 Reported-by: Ernst Sjöstrand
Diffstat (limited to 'tests/libtest')
-rw-r--r--tests/libtest/lib1502.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/libtest/lib1502.c b/tests/libtest/lib1502.c
index 6f253c7ec..5b75e2f2a 100644
--- a/tests/libtest/lib1502.c
+++ b/tests/libtest/lib1502.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -40,6 +40,7 @@
int test(char *URL)
{
CURL *easy = NULL;
+ CURL *dup;
CURLM *multi = NULL;
int still_running;
int res = 0;
@@ -72,6 +73,15 @@ int test(char *URL)
easy_setopt(easy, CURLOPT_HEADER, 1L);
easy_setopt(easy, CURLOPT_RESOLVE, dns_cache_list);
+ dup = curl_easy_duphandle(easy);
+ if(dup) {
+ curl_easy_cleanup(easy);
+ easy = dup;
+ }
+ else {
+ return CURLE_OUT_OF_MEMORY;
+ }
+
multi_init(multi);
multi_add_handle(multi, easy);