From 10fec734c9fc9f070de3b856bb90906eadcc4fa3 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 19 Oct 2021 11:29:21 +0200 Subject: [PATCH] CLEANUP: always initialize the answer_list Similar to the previous patch, the answer's list was only initialized the first time it was added to a list, leading to bogus outdated pointer to appear when debugging code is added around it to watch it. Let's make sure it's always initialized upon allocation. (cherry picked from commit 48664c048d17486b80e58459d2d4fa41a36e579e) Signed-off-by: Willy Tarreau (cherry picked from commit a2373e82f574fdba5fb52ff0ef917b16dd44484a) Signed-off-by: Christopher Faulet --- src/dns.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/dns.c b/src/dns.c index 1c62106..dee243d 100644 --- a/src/dns.c +++ b/src/dns.c @@ -1067,6 +1067,7 @@ static int dns_validate_dns_response(unsigned char *resp, unsigned char *bufend, dns_answer_record->ar_item = NULL; dns_answer_record->last_seen = TICK_ETERNITY; LIST_INIT(&dns_answer_record->attached_servers); + LIST_INIT(&dns_answer_record->list); offset = 0; len = dns_read_name(resp, bufend, reader, tmpname, DNS_MAX_NAME_SIZE, &offset, 0); -- 1.7.10.4