]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Don't look for KSK status here and squash memory leak
authorMark Andrews <marka@isc.org>
Wed, 13 Dec 2023 06:55:09 +0000 (17:55 +1100)
committerMark Andrews <marka@isc.org>
Wed, 20 Dec 2023 22:18:45 +0000 (09:18 +1100)
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.

lib/dns/zone.c

index 8ade0e8cb0fb9343573323691db168d630a2c522..1ab0b2e4e436a98ff85cacba62bc5798bf907dad 100644 (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];