mirror of
https://github.com/curl/curl.git
synced 2026-04-15 02:11:42 +03:00
ares: fix leak in tracing
When DNS tracing is enabled, a string allocated by ares was not freed. Reported-by: jmaggard10 on github Bug: https://github.com/curl/curl/pull/18251#pullrequestreview-3255785083 Closes #18691
This commit is contained in:
parent
f8f84b40cc
commit
976a08985a
2 changed files with 8 additions and 3 deletions
|
|
@ -747,8 +747,11 @@ struct Curl_addrinfo *Curl_async_getaddrinfo(struct Curl_easy *data,
|
|||
ares->result = CURLE_OK;
|
||||
|
||||
#if ARES_VERSION >= 0x011800 /* >= v1.24.0 */
|
||||
CURL_TRC_DNS(data, "asyn-ares: servers=%s",
|
||||
ares_get_servers_csv(ares->channel));
|
||||
if(CURL_TRC_DNS_is_verbose(data)) {
|
||||
char *csv = ares_get_servers_csv(ares->channel);
|
||||
CURL_TRC_DNS(data, "asyn-ares: servers=%s", csv);
|
||||
ares_free_string(csv);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CARES_GETADDRINFO
|
||||
|
|
|
|||
|
|
@ -123,6 +123,8 @@ void Curl_trc_ws(struct Curl_easy *data,
|
|||
|
||||
#define CURL_TRC_M_is_verbose(data) \
|
||||
Curl_trc_ft_is_verbose(data, &Curl_trc_feat_multi)
|
||||
#define CURL_TRC_DNS_is_verbose(data) \
|
||||
Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)
|
||||
|
||||
#if defined(CURL_HAVE_C99) && !defined(CURL_DISABLE_VERBOSE_STRINGS)
|
||||
#define infof(data, ...) \
|
||||
|
|
@ -141,7 +143,7 @@ void Curl_trc_ws(struct Curl_easy *data,
|
|||
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_read)) \
|
||||
Curl_trc_read(data, __VA_ARGS__); } while(0)
|
||||
#define CURL_TRC_DNS(data, ...) \
|
||||
do { if(Curl_trc_ft_is_verbose(data, &Curl_trc_feat_dns)) \
|
||||
do { if(CURL_TRC_DNS_is_verbose(data)) \
|
||||
Curl_trc_dns(data, __VA_ARGS__); } while(0)
|
||||
|
||||
#ifndef CURL_DISABLE_FTP
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue