From: Willy Tarreau Date: Tue, 19 Oct 2021 09:29:21 +0000 (+0200) Subject: CLEANUP: always initialize the answer_list X-Git-Tag: v2.5-dev11~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48664c048d17486b80e58459d2d4fa41a36e579e;p=thirdparty%2Fhaproxy.git 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. --- diff --git a/src/resolvers.c b/src/resolvers.c index 564cd4992d..7381e750e5 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);