multi: shut down CONNECT in Curl_detach_connnection

... to prevent a lingering pointer that would lead to a double-free.

Added test 1939 to verify.

Reported-by: Stephen M. Coakley
Fixes #7982
Closes #7986
This commit is contained in:
Daniel Stenberg 2021-11-10 14:42:04 +01:00
parent 11a46d6d66
commit f0b7099a10
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
6 changed files with 138 additions and 7 deletions

View file

@ -878,6 +878,7 @@ void Curl_detach_connnection(struct Curl_easy *data)
{
struct connectdata *conn = data->conn;
if(conn) {
Curl_connect_done(data); /* if mid-CONNECT, shut it down */
Curl_llist_remove(&conn->easyq, &data->conn_queue, NULL);
Curl_ssl_detach_conn(data, conn);
}