summaryrefslogtreecommitdiff
path: root/lib/url.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/url.c')
-rw-r--r--lib/url.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/url.c b/lib/url.c
index 48d697b3c..5f520e91e 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -788,6 +788,9 @@ CURLcode Curl_disconnect(struct Curl_easy *data,
free_fixed_hostname(&conn->http_proxy.host);
free_fixed_hostname(&conn->socks_proxy.host);
+ DEBUGASSERT(conn->data == data);
+ /* this assumes that the pointer is still there after the connection was
+ detected from the cache */
Curl_ssl_close(conn, FIRSTSOCKET);
conn_free(conn);
@@ -969,6 +972,7 @@ static bool extract_if_dead(struct connectdata *conn,
if(dead) {
infof(data, "Connection %ld seems to be dead!\n", conn->connection_id);
Curl_conncache_remove_conn(conn, FALSE);
+ conn->data = NULL; /* detach */
return TRUE;
}
}