aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2013-08-29 22:08:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2013-08-29 22:08:45 +0200
commit84f3b3dd448399f9548468676e1bd1475dba8de5 (patch)
treef79aea9e642c8caba3cd9b858f943a7b883e6518
parent2ef83136d4e6919fc6571bb8091748a56df3c60a (diff)
curl_multi_remove_handle: allow multiple removes
When removing an already removed handle, avoid that to ruin the internals and just return OK instead.
-rw-r--r--lib/multi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index fb495e078..e723a3ebf 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -483,6 +483,10 @@ CURLMcode curl_multi_remove_handle(CURLM *multi_handle,
if(!GOOD_EASY_HANDLE(curl_handle))
return CURLM_BAD_EASY_HANDLE;
+ /* Prevent users from trying to remove same easy handle more than once */
+ if(!data->multi)
+ return CURLM_OK; /* it is already removed so let's say it is fine! */
+
if(easy) {
bool premature = (data->mstate < CURLM_STATE_COMPLETED) ? TRUE : FALSE;
bool easy_owns_conn = (data->easy_conn &&