diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-04-28 20:27:07 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-04-28 20:27:07 +0000 |
commit | f611f42dcfa251a055339979930b2e2e3eb1a05a (patch) | |
tree | 076e58b638a2b72ac17fdbc964ec057e1c4ded07 /lib | |
parent | 7a0e0c36c549218f74ac5f1d4b679667135a97da (diff) |
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.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/easy.c | 8 |
1 files changed, 6 insertions, 2 deletions
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); |