← Commit list

1bddfe02d5

x2018
x2018
2025-11-09
SUCCESS Duration: 146s

Subject

asyn-thrdd: release rrname if ares_init_options fails

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/asyn-thrdd.c+4 -1
@@ -376,14 +376,17 @@ static CURLcode async_rr_start(struct Curl_easy *data, int port)
status = ares_init_options(&thrdd->rr.channel, NULL, 0);
if(status != ARES_SUCCESS) {
thrdd->rr.channel = NULL;
+ free(rrname);
return CURLE_FAILED_INIT;
}
#ifdef CURLDEBUG
if(getenv("CURL_DNS_SERVER")) {
const char *servers = getenv("CURL_DNS_SERVER");
status = ares_set_servers_ports_csv(thrdd->rr.channel, servers);
- if(status)
+ if(status) {
+ free(rrname);
return CURLE_FAILED_INIT;
+ }
}
#endif