]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
965. [bug] Using non root hints caused a rbtdb node reference
authorMark Andrews <marka@isc.org>
Mon, 27 Aug 2001 06:10:17 +0000 (06:10 +0000)
committerMark Andrews <marka@isc.org>
Mon, 27 Aug 2001 06:10:17 +0000 (06:10 +0000)
                        leak.    [RT #1581, RT #1618]

CHANGES
bin/named/query.c
lib/dns/view.c

diff --git a/CHANGES b/CHANGES
index 8abccd5de1fec411e5b4204d3fcafb927566f57d..16f823c234eedcf581171874e330c71b5b504d48 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+ 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.
 
  963.  [bug]           bad ISC_LANG_ENDDECLS. [RT #1645]
index 6933ddfd6011b13cf9603c1fb68038211e6c358a..70a472d0eb977d05ebe95542d1b5dccdf0a49af9 100644 (file)
@@ -15,7 +15,7 @@
  * 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>
 
@@ -2608,6 +2608,10 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
                                             rdataset, sigrdataset);
                }
                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 may have working forwarders, so try to
index 5931225a358e107c17e6cbff568088b48ee8ebcb..405701630a2fc685855e440a745f926e8cec7c96 100644 (file)
@@ -15,7 +15,7 @@
  * 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>
 
@@ -749,6 +749,12 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
                        result = DNS_R_HINTNXRRSET;
                } else if (result == DNS_R_NXDOMAIN)
                        result = ISC_R_NOTFOUND;
+
+               /*
+                * Cleanup if non-standard hints are used.
+                */
+               if (db == NULL && node != NULL)
+                       dns_db_detachnode(view->hints, &node);
        }
 
  cleanup:
@@ -786,7 +792,8 @@ dns_view_find(dns_view_t *view, dns_name_t *name, dns_rdatatype_t type,
                        *dbp = db;
                else
                        dns_db_detach(&db);
-       }
+       } else
+               INSIST(node == NULL);
 
        if (zone != NULL)
                dns_zone_detach(&zone);
@@ -992,6 +999,7 @@ dns_view_findzonecut(dns_view_t *view, dns_name_t *name, dns_name_t *fname,
                         * nameservers!
                         */
                        result = ISC_R_NOTFOUND;
+                       INSIST(!dns_rdataset_isassociated(rdataset));
                }
        }