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:
committed by
Mark Andrews
parent
35bd7e4da0
commit
89b269b0d2
@@ -1297,9 +1297,7 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
|
||||
* We found an answer, but the cache may be better.
|
||||
*/
|
||||
zfname = dns_fixedname_name(&zfixedname);
|
||||
result = dns_name_copy(fname, zfname, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
RUNTIME_CHECK(dns_name_copy(fname, zfname, NULL) == ISC_R_SUCCESS);
|
||||
dns_rdataset_clone(rdataset, &zrdataset);
|
||||
dns_rdataset_disassociate(rdataset);
|
||||
if (sigrdataset != NULL &&
|
||||
@@ -1340,6 +1338,7 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
|
||||
*/
|
||||
try_hints = true;
|
||||
}
|
||||
result = ISC_R_SUCCESS;
|
||||
} else {
|
||||
/*
|
||||
* Something bad happened.
|
||||
@@ -1356,13 +1355,9 @@ dns_view_findzonecut(dns_view_t *view, const dns_name_t *name,
|
||||
dns_rdataset_isassociated(sigrdataset))
|
||||
dns_rdataset_disassociate(sigrdataset);
|
||||
}
|
||||
result = dns_name_copy(zfname, fname, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
RUNTIME_CHECK(dns_name_copy(zfname, fname, NULL) == ISC_R_SUCCESS);
|
||||
if (dcname != NULL) {
|
||||
result = dns_name_copy(zfname, dcname, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
goto cleanup;
|
||||
RUNTIME_CHECK(dns_name_copy(zfname, dcname, NULL) == ISC_R_SUCCESS);
|
||||
}
|
||||
dns_rdataset_clone(&zrdataset, rdataset);
|
||||
if (sigrdataset != NULL &&
|
||||
@@ -2165,9 +2160,7 @@ dns_view_searchdlz(dns_view_t *view, const dns_name_t *name,
|
||||
*/
|
||||
for (i = namelabels; i > minlabels && i > 1; i--) {
|
||||
if (i == namelabels) {
|
||||
result = dns_name_copy(name, zonename, NULL);
|
||||
if (result != ISC_R_SUCCESS)
|
||||
return (result);
|
||||
RUNTIME_CHECK(dns_name_copy(name, zonename, NULL) == ISC_R_SUCCESS);
|
||||
} else
|
||||
dns_name_split(name, i, NULL, zonename);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user