diff options
author | Björn Stenberg <bjst@bjorn> | 2013-11-08 00:09:20 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2013-11-10 22:49:56 +0000 |
commit | e7d77fb3ef14bac8690f343327b302f866ac53f2 (patch) | |
tree | f6447320eb2516c46c53405718601cad61efa965 /lib/url.c | |
parent | c8e63f247aa14a6721b0d04f444d258e690b0dc8 (diff) |
connect: Close temporary sockets in conn_free()
The temporary sockets used for Happy Eyeballs were not closed properly,
if curl exited prematurely, which this patch fixes.
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -2503,6 +2503,10 @@ static void conn_free(struct connectdata *conn) Curl_closesocket(conn, conn->sock[SECONDARYSOCKET]); if(CURL_SOCKET_BAD != conn->sock[FIRSTSOCKET]) Curl_closesocket(conn, conn->sock[FIRSTSOCKET]); + if(CURL_SOCKET_BAD != conn->tempsock[0]) + Curl_closesocket(conn, conn->tempsock[0]); + if(CURL_SOCKET_BAD != conn->tempsock[1]) + Curl_closesocket(conn, conn->tempsock[1]); #if defined(USE_NTLM) && defined(NTLM_WB_ENABLED) Curl_ntlm_wb_cleanup(conn); @@ -3522,6 +3526,8 @@ static struct connectdata *allocate_conn(struct SessionHandle *data) conn->sock[FIRSTSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ conn->sock[SECONDARYSOCKET] = CURL_SOCKET_BAD; /* no file descriptor */ + conn->tempsock[0] = CURL_SOCKET_BAD; /* no file descriptor */ + conn->tempsock[1] = CURL_SOCKET_BAD; /* no file descriptor */ conn->connection_id = -1; /* no ID */ conn->port = -1; /* unknown at this point */ |