Welcome! Log In Create A New Profile

Advanced

[nginx] Resolver: fixed memory leak for the "ipv4=off" case.

Sergey Kandaurov
July 14, 2022 01:34PM
details: https://hg.nginx.org/nginx/rev/0422365794f7
branches:
changeset: 8056:0422365794f7
user: Sergey Kandaurov <pluknet@nginx.com>
date: Thu Jul 14 21:26:54 2022 +0400
description:
Resolver: fixed memory leak for the "ipv4=off" case.

This change partially reverts 2a77754cd9fe to properly free rn->query.

Found by Coverity (CID 1507244).

diffstat:

src/core/ngx_resolver.c | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)

diffs (15 lines):

diff -r 2a77754cd9fe -r 0422365794f7 src/core/ngx_resolver.c
--- a/src/core/ngx_resolver.c Tue Jul 12 21:44:02 2022 +0400
+++ b/src/core/ngx_resolver.c Thu Jul 14 21:26:54 2022 +0400
@@ -3684,10 +3684,7 @@ ngx_resolver_create_name_query(ngx_resol
}

rn->qlen = (u_short) len;
-
- if (r->ipv4) {
- rn->query = p;
- }
+ rn->query = p;

#if (NGX_HAVE_INET6)
if (r->ipv6) {
_______________________________________________
nginx-devel mailing list -- nginx-devel@nginx.org
To unsubscribe send an email to nginx-devel-leave@nginx.org
Subject Author Views Posted

[nginx] Resolver: fixed memory leak for the "ipv4=off" case.

Sergey Kandaurov 276 July 14, 2022 01:34PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 49
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready