From 48664c048d17486b80e58459d2d4fa41a36e579e 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. --- src/resolvers.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/resolvers.c b/src/resolvers.c index 564cd4992..7381e750e 100644 --- a/src/resolvers.c +++ b/src/resolvers.c @@ -991,6 +991,7 @@ static int resolv_validate_dns_response(unsigned char *resp, unsigned char *bufe answer_record->ar_item = NULL; answer_record->last_seen = TICK_ETERNITY; LIST_INIT(&answer_record->attached_servers); + LIST_INIT(&answer_record->list); offset = 0; len = resolv_read_name(resp, bufend, reader, tmpname, DNS_MAX_NAME_SIZE, &offset, 0);