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

Don't look for KSK status here and squash memory leak

Just remove the key from  consideration as it is being removed.

The old code could leak a key reference as dst_free_key was not
called every time we continued. This simplification will address
this as well.
This commit is contained in:
Mark Andrews
2023-12-13 17:55:09 +11:00
parent 31560dce1a
commit a3d0476d17

View File

@@ -9149,16 +9149,7 @@ zone_sign(dns_zone_t *zone) {
if (ALG(zone_keys[i]) == signing->algorithm &&
dst_key_id(zone_keys[i]) == signing->keyid)
{
bool ksk = false;
isc_result_t ret = dst_key_getbool(
zone_keys[i], DST_BOOL_KSK,
&ksk);
if (ret != ISC_R_SUCCESS) {
ksk = KSK(zone_keys[i]);
}
if (ksk) {
dst_key_free(&zone_keys[i]);
}
dst_key_free(&zone_keys[i]);
continue;
}
zone_keys[j] = zone_keys[i];