]> granicus.if.org Git - curl/commitdiff
disconnect: set conn->data for protocol disconnect
authorDaniel Stenberg <daniel@haxx.se>
Sun, 23 Dec 2018 16:38:59 +0000 (17:38 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 23 Dec 2018 22:12:40 +0000 (23:12 +0100)
Follow-up to fb445a1e18d: Set conn->data explicitly to point out the
current transfer when invoking the protocol-specific disconnect function
so that it can work correctly.

Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12173

lib/url.c

index 50719ce548de861d5beed064b0d473400a1ec7d5..bf92016d07a7f8bd4ad40431150f0df11f4e51c9 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -781,6 +781,9 @@ CURLcode Curl_disconnect(struct Curl_easy *data,
   Curl_http_ntlm_cleanup(conn);
 #endif
 
+  /* the protocol specific disconnect handler needs a transfer for its
+     connection! */
+  conn->data = data;
   if(conn->handler->disconnect)
     /* This is set if protocol-specific cleanups should be made */
     conn->handler->disconnect(conn, dead_connection);