]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
minor findnode optimization
authorEvan Hunt <each@isc.org>
Fri, 12 Jul 2024 21:06:20 +0000 (14:06 -0700)
committerOndřej Surý <ondrej@isc.org>
Mon, 5 Aug 2024 13:36:41 +0000 (13:36 +0000)
when searching the cache for a node so that we can delete an
rdataset, it is not necessary to set the 'create' flag. if the
node doesn't exist yet, we then we won't be able to delete
anything from it anyway.

lib/dns/resolver.c

index 5afa72f9356924437f73b8d4c8abd15fb8374c56..a2fd672d795f1cbd7436d1fe5b74bc72907337a2 100644 (file)
@@ -5220,7 +5220,7 @@ validated(void *arg) {
                        result = ISC_R_NOTFOUND;
                        if (val->rdataset != NULL) {
                                result = dns_db_findnode(fctx->cache, val->name,
-                                                        true, &node);
+                                                        false, &node);
                        }
                        if (result == ISC_R_SUCCESS) {
                                (void)dns_db_deleterdataset(fctx->cache, node,
@@ -5858,7 +5858,6 @@ cache_name(fetchctx_t *fctx, dns_name_t *name, dns_message_t *message,
        /*
         * Find or create the cache node.
         */
-       node = NULL;
        result = dns_db_findnode(fctx->cache, name, true, &node);
        if (result != ISC_R_SUCCESS) {
                return (result);