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
This commit is contained in:
Daniel Stenberg 2020-11-26 17:28:39 +01:00
parent d6ced230fe
commit 0b60d3685e
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 1 additions and 1 deletions

View File

@ -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