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
@@ -229,15 +229,7 @@ syncptr(sample_instance_t *inst, dns_name_t *name,
|
||||
/* Reverse zone is managed by this driver, prepare PTR record */
|
||||
pevent->zone = NULL;
|
||||
dns_zone_attach(ptr_zone, &pevent->zone);
|
||||
result = dns_name_copy(name,
|
||||
dns_fixedname_name(&pevent->ptr_target_name),
|
||||
NULL);
|
||||
if (result != ISC_R_SUCCESS) {
|
||||
log_write(ISC_LOG_ERROR,
|
||||
"syncptr: dns_name_copy -> %s\n",
|
||||
isc_result_totext(result));
|
||||
goto cleanup;
|
||||
}
|
||||
RUNTIME_CHECK(dns_name_copy(name, dns_fixedname_name(&pevent->ptr_target_name), NULL) == ISC_R_SUCCESS);
|
||||
dns_name_clone(dns_fixedname_name(&pevent->ptr_target_name),
|
||||
&ptr_struct.ptr);
|
||||
dns_diff_init(inst->mctx, &pevent->diff);
|
||||
|
||||
Reference in New Issue
Block a user