Skip to content

Commit

Permalink
Resolver: fixed memory leak for the "ipv4=off" case.
Browse files Browse the repository at this point in the history
This change partially reverts 2a77754cd9fe to properly free rn->query.

Found by Coverity (CID 1507244).
  • Loading branch information
pluknet committed Jul 14, 2022
1 parent 5178da4 commit 14341ce
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/ngx_resolver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 14341ce

Please sign in to comment.