From: Daniel Stenberg Date: Thu, 26 Nov 2020 16:28:39 +0000 (+0100) Subject: socks: check for DNS entries with the right port number X-Git-Tag: curl-7_74_0~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0b60d3685e4705e2c0fe4ae9aa7cea4138fbce6d;p=thirdparty%2Fcurl.git socks: check for DNS entries with the right port number The resolve call is done with the right port number, but the subsequent check used the wrong one, which then could find a previous resolve which would return and leave the fresh resolve "incomplete" and leaking memory. Fixes #6247 Closes #6253 --- diff --git a/lib/socks.c b/lib/socks.c index d9f67ec577..a2d1e621f9 100644 --- a/lib/socks.c +++ b/lib/socks.c @@ -771,7 +771,7 @@ CURLproxycode Curl_SOCKS5(const char *proxy_user, case CONNECT_RESOLVING: /* check if we have the name resolved by now */ - dns = Curl_fetch_addr(conn, hostname, (int)conn->port); + dns = Curl_fetch_addr(conn, hostname, remote_port); if(dns) { #ifdef CURLRES_ASYNCH