2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

Add RUNTIME_CHECK() around result = dns_name_copy(..., NULL) calls

This second commit uses second semantic patch to replace the calls to
dns_name_copy() with NULL as third argument where the result was stored in a
isc_result_t variable.  As the dns_name_copy(..., NULL) cannot fail gracefully
when the third argument is NULL, it was just a bunch of dead code.

Couple of manual tweaks (removing dead labels and unused variables) were
manually applied on top of the semantic patch.
This commit is contained in:
Ondřej Surý
2019-09-10 13:55:18 +02:00
committed by Mark Andrews
parent 35bd7e4da0
commit 89b269b0d2
15 changed files with 26 additions and 120 deletions

View File

@@ -997,18 +997,7 @@ findext(dns_db_t *db, const dns_name_t *name, dns_dbversion_t *version,
dns_rdataset_disassociate(rdataset);
if (foundname != NULL) {
isc_result_t xresult;
xresult = dns_name_copy(xname, foundname, NULL);
if (xresult != ISC_R_SUCCESS) {
if (node != NULL) {
detachnode(db, &node);
}
if (dns_rdataset_isassociated(rdataset)) {
dns_rdataset_disassociate(rdataset);
}
return (DNS_R_BADDB);
}
RUNTIME_CHECK(dns_name_copy(xname, foundname, NULL) == ISC_R_SUCCESS);
}
if (nodep != NULL)