comparison src/core/ngx_resolver.c @ 8056:0422365794f7

Resolver: fixed memory leak for the "ipv4=off" case. This change partially reverts 2a77754cd9fe to properly free rn->query. Found by Coverity (CID 1507244).
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 14 Jul 2022 21:26:54 +0400
parents 2a77754cd9fe
children c363ad6b3b23
comparison
equal deleted inserted replaced
8055:2a77754cd9fe 8056:0422365794f7
3682 if (p == NULL) { 3682 if (p == NULL) {
3683 return NGX_ERROR; 3683 return NGX_ERROR;
3684 } 3684 }
3685 3685
3686 rn->qlen = (u_short) len; 3686 rn->qlen = (u_short) len;
3687 3687 rn->query = p;
3688 if (r->ipv4) {
3689 rn->query = p;
3690 }
3691 3688
3692 #if (NGX_HAVE_INET6) 3689 #if (NGX_HAVE_INET6)
3693 if (r->ipv6) { 3690 if (r->ipv6) {
3694 rn->query6 = r->ipv4 ? (p + len) : p; 3691 rn->query6 = r->ipv4 ? (p + len) : p;
3695 } 3692 }