url: use the socks type for socks proxy

Reported by Codex Security

Closes #21025
This commit is contained in:
Daniel Stenberg 2026-03-20 11:06:47 +01:00
parent 14782b36fe
commit e3ed70ce72
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -2248,16 +2248,16 @@ static CURLcode create_conn_helper_init_proxy(struct Curl_easy *data,
* connection that may exist registered to the same proxy host.
***********************************************************************/
if(proxy || socksproxy) {
long ptype = conn->http_proxy.proxytype;
if(proxy) {
result = parse_proxy(data, conn, proxy, ptype);
result = parse_proxy(data, conn, proxy, conn->http_proxy.proxytype);
Curl_safefree(proxy); /* parse_proxy copies the proxy string */
if(result)
goto out;
}
if(socksproxy) {
result = parse_proxy(data, conn, socksproxy, ptype);
result = parse_proxy(data, conn, socksproxy,
conn->socks_proxy.proxytype);
/* parse_proxy copies the socks proxy string */
Curl_safefree(socksproxy);
if(result)