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

4 comments on commit 14341ce

@l6858382
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one

@Dayan0000
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this judgment added and deleted
5178da4#r100084091

@sinloss
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this judgment added and deleted 5178da4#r100084091

Because this seemingly memory leak has been identified as False Positive, i.e., further investigation has revealed that it (CVE-2022-3638) was not a security issue at all.

Source:

@andrewzbl
Copy link

@andrewzbl andrewzbl commented on 14341ce Mar 28, 2023 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.