aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/url.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/url.c b/lib/url.c
index 54d2ff929..edfa3edcc 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2300,6 +2300,11 @@ static void conn_free(struct connectdata *conn)
if(!conn)
return;
+ /* close the SSL stuff before we close any sockets since they will/may
+ write to the sockets */
+ Curl_ssl_close(conn, FIRSTSOCKET);
+ Curl_ssl_close(conn, SECONDARYSOCKET);
+
/* close possibly still open sockets */
if(CURL_SOCKET_BAD != conn->sock[SECONDARYSOCKET])
sclose(conn->sock[SECONDARYSOCKET]);
@@ -2336,9 +2341,6 @@ static void conn_free(struct connectdata *conn)
Curl_destroy_thread_data(&conn->async);
#endif
- Curl_ssl_close(conn, FIRSTSOCKET);
- Curl_ssl_close(conn, SECONDARYSOCKET);
-
Curl_free_ssl_config(&conn->ssl_config);
free(conn); /* free all the connection oriented data */