← Commit list

70ec11358c

Max Dymond
Max Dymond
2026-03-04
SUCCESS Duration: 249s

Subject

socks: ensure DNS is freed in failure cases.

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

lib/socks.c+3 -0
@@ -341,6 +341,8 @@ static CURLproxycode socks4_resolving(struct socks_state *sx,
if(result || !dns) {
failf(data, "Failed to resolve \"%s\" for SOCKS4 connect.", sx->hostname);
+ if(dns)
+ Curl_resolv_unlink(data, &dns);
return CURLPX_RESOLVE_HOST;
}
@@ -371,6 +373,7 @@ static CURLproxycode socks4_resolving(struct socks_state *sx,
return CURLPX_SEND_REQUEST;
}
else {
+ Curl_resolv_unlink(data, &dns);
failf(data, "SOCKS4 connection to %s not supported", sx->hostname);
return CURLPX_RESOLVE_HOST;
}