From ecda717550f127cba1963fc16f9da4faaf5a7230 Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Wed, 3 Nov 1999 23:50:39 +0000 Subject: [PATCH] deal with negative responses in query_simplefind() --- bin/named/query.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/named/query.c b/bin/named/query.c index ef1c2a978a..af92295d98 100644 --- a/bin/named/query.c +++ b/bin/named/query.c @@ -416,6 +416,8 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type, dns_zone_t *zone; REQUIRE(NS_CLIENT_VALID(client)); + REQUIRE(rdataset != NULL); + REQUIRE(sigrdataset != NULL); dns_rdataset_init(&zrdataset); dns_rdataset_init(&zsigrdataset); @@ -520,8 +522,13 @@ query_simplefind(void *arg, dns_name_t *name, dns_rdatatype_t type, * Otherwise, the glue is the best answer. */ result = ISC_R_SUCCESS; - } else if (result != ISC_R_SUCCESS) + } else if (result != ISC_R_SUCCESS) { + if (rdataset->methods != NULL) + dns_rdataset_disassociate(rdataset); + if (sigrdataset->methods != NULL) + dns_rdataset_disassociate(sigrdataset); result = DNS_R_NOTFOUND; + } cleanup: if (zrdataset.methods != NULL) {