mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 14:35:26 +00:00
Fix dns_kasp_attach / dns_kasp_detach usage
The kasp pointers in dns_zone_t should consistently be changed by dns_kasp_attach and dns_kasp_detach so the usage is balanced.
This commit is contained in:
committed by
Matthijs Mekking
parent
28cde5cac2
commit
59cd228216
@@ -1202,9 +1202,9 @@ named_zone_configure(const cfg_obj_t *config, const cfg_obj_t *vconfig,
|
||||
result = dns_kasplist_find(kasplist, "default", &kasp);
|
||||
INSIST(result == ISC_R_SUCCESS && kasp != NULL);
|
||||
dns_zone_setdefaultkasp(zone, kasp);
|
||||
dns_kasp_detach(&kasp);
|
||||
|
||||
obj = NULL;
|
||||
kasp = NULL;
|
||||
result = named_config_get(maps, "dnssec-policy", &obj);
|
||||
if (result == ISC_R_SUCCESS) {
|
||||
kaspname = cfg_obj_asstring(obj);
|
||||
|
@@ -5725,11 +5725,11 @@ dns_zone_setdefaultkasp(dns_zone_t *zone, dns_kasp_t *kasp) {
|
||||
|
||||
LOCK_ZONE(zone);
|
||||
if (zone->defaultkasp != NULL) {
|
||||
dns_kasp_t *oldkasp = zone->defaultkasp;
|
||||
zone->defaultkasp = NULL;
|
||||
dns_kasp_detach(&oldkasp);
|
||||
dns_kasp_detach(&zone->defaultkasp);
|
||||
}
|
||||
if (kasp != NULL) {
|
||||
dns_kasp_attach(kasp, &zone->defaultkasp);
|
||||
}
|
||||
zone->defaultkasp = kasp;
|
||||
UNLOCK_ZONE(zone);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user