From 0f5895faee96934fdeea82f42f45bb3e53b915e5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Thu, 11 Dec 2008 23:52:56 +0000 Subject: - Bug report #2416182 titled "crash in ConnectionExists when using duphandle+curl_mutli" (http://curl.haxx.se/bug/view.cgi?id=2416182) showed that curl_easy_duphandle() wrongly also copied the pointer to the connection cache, which was plain wrong and caused a segfault if the handle would be used in a different multi handle than the handle it was duplicated from. --- lib/easy.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'lib') diff --git a/lib/easy.c b/lib/easy.c index 2c2490142..ae669f9be 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -624,13 +624,8 @@ CURL *curl_easy_duphandle(CURL *incurl) if(Curl_dupset(outcurl, data) != CURLE_OK) break; - if(data->state.used_interface == Curl_if_multi) - outcurl->state.connc = data->state.connc; - else - outcurl->state.connc = Curl_mk_connc(CONNCACHE_PRIVATE, -1); - - if(!outcurl->state.connc) - break; + /* the connection cache is setup on demand */ + outcurl->state.connc = NULL; outcurl->state.lastconnect = -1; -- cgit v1.2.3