From f611f42dcfa251a055339979930b2e2e3eb1a05a Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 28 Apr 2007 20:27:07 +0000 Subject: Frank Hempel fixed a curl_easy_duphandle() crash on a handle that had been removed from a multi handle, and then fixed another flaw that prevented curl_easy_duphandle() to work even after the first fix - the handle was still marked as using the multi interface. --- lib/easy.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/easy.c b/lib/easy.c index 939966dde..8f590c97b 100644 --- a/lib/easy.c +++ b/lib/easy.c @@ -511,6 +511,10 @@ void Curl_easy_addmulti(struct SessionHandle *data, void *multi) { data->multi = multi; + if (multi == NULL) + /* the association is cleared, mark the easy handle as not used by an + interface */ + data->state.used_interface = Curl_if_none; } void Curl_easy_initHandleData(struct SessionHandle *data) @@ -636,8 +640,8 @@ CURL *curl_easy_duphandle(CURL *incurl) if(fail) { if(outcurl) { - if((outcurl->state.connc->type == CONNCACHE_PRIVATE) && - outcurl->state.connc) + if(outcurl->state.connc && + (outcurl->state.connc->type == CONNCACHE_PRIVATE)) Curl_rm_connc(outcurl->state.connc); if(outcurl->state.headerbuff) free(outcurl->state.headerbuff); -- cgit v1.2.3