From 6de860497e8519d7d327f270ec9ec343b83bf75b Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 22 Jul 2020 11:09:21 -0400 Subject: log: Don't use twice fmt_addr() in same logging statement Fixes #40059 Signed-off-by: David Goulet --- src/feature/dirclient/dirclient.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/feature/dirclient') diff --git a/src/feature/dirclient/dirclient.c b/src/feature/dirclient/dirclient.c index 7a026d3c52..337fa4c965 100644 --- a/src/feature/dirclient/dirclient.c +++ b/src/feature/dirclient/dirclient.c @@ -686,12 +686,14 @@ directory_choose_address_routerstatus(const routerstatus_t *status, * connect to it. */ if (!have_or && !have_dir) { static int logged_backtrace = 0; + char *ipv6_str = tor_addr_to_str_dup(&status->ipv6_addr); log_info(LD_BUG, "Rejected all OR and Dir addresses from %s when " "launching an outgoing directory connection to: IPv4 %s OR %d " "Dir %d IPv6 %s OR %d Dir %d", routerstatus_describe(status), fmt_addr(&status->ipv4_addr), status->ipv4_orport, - status->ipv4_dirport, fmt_addr(&status->ipv6_addr), - status->ipv6_orport, status->ipv4_dirport); + status->ipv4_dirport, ipv6_str, status->ipv6_orport, + status->ipv4_dirport); + tor_free(ipv6_str); if (!logged_backtrace) { log_backtrace(LOG_INFO, LD_BUG, "Addresses came from"); logged_backtrace = 1; -- cgit v1.2.3-54-g00ecf