From 14341ce2377d38a268261e0fec65b6915ae6e95e Mon Sep 17 00:00:00 2001 From: Sergey Kandaurov Date: Thu, 14 Jul 2022 21:26:54 +0400 Subject: [PATCH] Resolver: fixed memory leak for the "ipv4=off" case. This change partially reverts 2a77754cd9fe to properly free rn->query. Found by Coverity (CID 1507244). --- src/core/ngx_resolver.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c index 36bd46df6..c76c17852 100644 --- a/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c @@ -3684,10 +3684,7 @@ ngx_resolver_create_name_query(ngx_resolver_t *r, ngx_resolver_node_t *rn, } rn->qlen = (u_short) len; - - if (r->ipv4) { - rn->query = p; - } + rn->query = p; #if (NGX_HAVE_INET6) if (r->ipv6) {