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/connect.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/connect.c')
-rw-r--r-- | lib/connect.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/connect.c b/lib/connect.c index 2fd9883b9..67f73343c 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -758,10 +758,13 @@ CURLcode Curl_is_connected(struct connectdata *conn, /* use this socket from now on */ conn->sock[sockindex] = conn->tempsock[i]; conn->ip_addr = conn->tempaddr[i]; + conn->tempsock[i] = CURL_SOCKET_BAD; /* close the other socket, if open */ - if(conn->tempsock[other] != CURL_SOCKET_BAD) + if(conn->tempsock[other] != CURL_SOCKET_BAD) { Curl_closesocket(conn, conn->tempsock[other]); + conn->tempsock[other] = CURL_SOCKET_BAD; + } /* see if we need to do any proxy magic first once we connected */ code = Curl_connected_proxy(conn, sockindex); |