]> 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 23:05:54 +0000 (10:05 +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.

(cherry picked from commit a3d0476d1793a2095047c8e911b33f8bf0ee04cf)

lib/dns/zone.c

index b60764a4cb1c1fa9fa36b43cd982890d8c3a81f8..729adcb6e48929f800ca36d6a474193935b87f10 100644 (file)
@@ -9657,16 +9657,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];