Commit 89555ff4 authored by Mark Andrews's avatar Mark Andrews
Browse files

965. [bug] Using non root hints caused a rbtdb node reference

                        leak.    [RT #1581, RT #1618]
parent 440906ce
965. [bug] Using non root hints caused a rbtdb node reference
leak. [RT #1581, RT #1618]
964. [func] Warn if non root hints data is found in hints file. 964. [func] Warn if non root hints data is found in hints file.
963. [bug] bad ISC_LANG_ENDDECLS. [RT #1645] 963. [bug] bad ISC_LANG_ENDDECLS. [RT #1645]
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: query.c,v 1.196 2001/06/15 23:28:27 gson Exp $ */ /* $Id: query.c,v 1.197 2001/08/27 06:10:15 marka Exp $ */
#include <config.h> #include <config.h>
...@@ -2608,6 +2608,10 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype) ...@@ -2608,6 +2608,10 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
rdataset, sigrdataset); rdataset, sigrdataset);
} }
if (result != ISC_R_SUCCESS) { if (result != ISC_R_SUCCESS) {
INSIST(node == NULL);
INSIST(!dns_rdataset_isassociated(rdataset));
INSIST(sigrdataset == NULL ||
!dns_rdataset_isassociated(sigrdataset));
/* /*
* We don't have any root server hints, but * We don't have any root server hints, but
* we may have working forwarders, so try to * we may have working forwarders, so try to
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: view.c,v 1.101 2001/07/26 20:42:44 bwelling Exp $ */ /* $Id: view.c,v 1.102 2001/08/27 06:10:17 marka Exp $ */
#include <config.h> #include <config.h>
...@@ -749,6 +749,12 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, ...@@ -749,6 +749,12 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
result = DNS_R_HINTNXRRSET; result = DNS_R_HINTNXRRSET;
} else if (result == DNS_R_NXDOMAIN) } else if (result == DNS_R_NXDOMAIN)
result = ISC_R_NOTFOUND; result = ISC_R_NOTFOUND;
/*
* Cleanup if non-standard hints are used.
*/
if (db == NULL && node != NULL)
dns_db_detachnode(view->hints, &node);
} }
cleanup: cleanup:
...@@ -786,7 +792,8 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type, ...@@ -786,7 +792,8 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
*dbp = db; *dbp = db;
else else
dns_db_detach(&db); dns_db_detach(&db);
} } else
INSIST(node == NULL);
if (zone != NULL) if (zone != NULL)
dns_zone_detach(&zone); dns_zone_detach(&zone);
...@@ -992,6 +999,7 @@ dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname, ...@@ -992,6 +999,7 @@ dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
* nameservers! * nameservers!
*/ */
result = ISC_R_NOTFOUND; result = ISC_R_NOTFOUND;
INSIST(!dns_rdataset_isassociated(rdataset));
} }
} }
......
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