multi: fix crash due to dangling entry in connect-pending list

Fixes #2677
Closes #2679
This commit is contained in:
Javier Blazquez 2018-06-22 20:11:26 -07:00 committed by Daniel Stenberg
parent 146178a9df
commit 4c901638b4
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 109 additions and 2 deletions

View file

@ -712,6 +712,11 @@ CURLMcode curl_multi_remove_handle(struct Curl_multi *multi,
Curl_getoff_all_pipelines(data, data->easy_conn);
}
if(data->connect_queue.ptr)
/* the handle was in the pending list waiting for an available connection,
so go ahead and remove it */
Curl_llist_remove(&multi->pending, &data->connect_queue, NULL);
if(data->dns.hostcachetype == HCACHE_MULTI) {
/* stop using the multi handle's DNS cache, *after* the possible
multi_done() call above */