]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix a bug in rpz.c:del_name()
authorAram Sargsyan <aram@isc.org>
Wed, 11 Mar 2026 12:39:51 +0000 (12:39 +0000)
committerOndřej Surý (GitLab job 7027354) <ondrej@isc.org>
Sat, 14 Mar 2026 12:43:37 +0000 (12:43 +0000)
When the dns_qp_getname() call returns an error the del_name() function
just returns without cleaning up the trasnaction.

Instead of returning, jump to a new label 'done:' similar to the code
written in the add_nm() function.

(cherry picked from commit 4df5b9ac32fd3adb9bd1dfa94a778edd1cda04c5)

lib/dns/rpz.c

index 0d61fdf364993009de94567db15d9a4dc821ab80..5fea09877de501e2f6964584ecf2b79298736b76 100644 (file)
@@ -2370,7 +2370,8 @@ del_name(dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
 
        result = dns_qp_getname(qp, trig_name, (void **)&data, NULL);
        if (result != ISC_R_SUCCESS) {
-               return;
+               INSIST(data == NULL);
+               goto done;
        }
 
        INSIST(data != NULL);
@@ -2412,6 +2413,7 @@ del_name(dns_rpz_zone_t *rpz, dns_rpz_type_t rpz_type,
                RWUNLOCK(&rpz->rpzs->search_lock, isc_rwlocktype_write);
        }
 
+done:
        dns_qp_compact(qp, DNS_QPGC_MAYBE);
        dns_qpmulti_commit(rpzs->table, &qp);
 }