Commit 8d80b493 authored by Mark Andrews's avatar Mark Andrews

4221. [bug] Resource leak on DNS_R_NXDOMAIN in fctx_create.

                        [RT #40583]
parent 5ca309a0
4221. [bug] Resource leak on DNS_R_NXDOMAIN in fctx_create.
[RT #40583]
4220. [doc] Improve documentation for zone-statistics.
[RT #36955]
......
......@@ -4275,13 +4275,12 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
&fctx->nameservers,
NULL);
if (result != ISC_R_SUCCESS)
goto cleanup_name;
goto cleanup_nameservers;
result = dns_name_dup(domain, mctx, &fctx->domain);
if (result != ISC_R_SUCCESS) {
dns_rdataset_disassociate(&fctx->nameservers);
goto cleanup_name;
}
if (result != ISC_R_SUCCESS)
goto cleanup_nameservers;
fctx->ns_ttl = fctx->nameservers.ttl;
fctx->ns_ttl_ok = ISC_TRUE;
} else {
......@@ -4403,6 +4402,8 @@ fctx_create(dns_resolver_t *res, dns_name_t *name, dns_rdatatype_t type,
cleanup_domain:
if (dns_name_countlabels(&fctx->domain) > 0)
dns_name_free(&fctx->domain, mctx);
cleanup_nameservers:
if (dns_rdataset_isassociated(&fctx->nameservers))
dns_rdataset_disassociate(&fctx->nameservers);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment