mirror of
https://github.com/curl/curl.git
synced 2026-08-24 12:03:34 +03:00
- Constantine Sapuntzakis identified a write after close, as the sockets were
closed by libcurl before the SSL lib were shutdown and they may write to its socket. Detected to at least happen with OpenSSL builds.
This commit is contained in:
parent
c3266a5eb1
commit
504e6d7ae6
3 changed files with 10 additions and 3 deletions
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue