]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolved-dns-trust-anchor: use hash_ops with destructor for managing RRs
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Apr 2025 14:24:21 +0000 (23:24 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Apr 2025 00:58:49 +0000 (09:58 +0900)
src/resolve/resolved-dns-rr.c
src/resolve/resolved-dns-trust-anchor.c

index 7f0bd35d3c7701cd6f3b0806a07d9944c8614c1d..6837c9ece404d8fa29691fedc42a0457bf0516c1 100644 (file)
@@ -1686,7 +1686,12 @@ int dns_resource_record_compare_func(const DnsResourceRecord *x, const DnsResour
         return CMP(x, y);
 }
 
-DEFINE_HASH_OPS(dns_resource_record_hash_ops, DnsResourceRecord, dns_resource_record_hash_func, dns_resource_record_compare_func);
+DEFINE_HASH_OPS_WITH_KEY_DESTRUCTOR(
+                dns_resource_record_hash_ops,
+                DnsResourceRecord,
+                dns_resource_record_hash_func,
+                dns_resource_record_compare_func,
+                dns_resource_record_unref);
 
 DEFINE_HASH_OPS_FULL(
                 dns_resource_record_hash_ops_by_key,
index 94e0da404bcf5e652ea7c467407a6a5872a47cd1..ae20f712cbb80ff5dbd00d595e5f293bf0765263 100644 (file)
@@ -542,7 +542,7 @@ void dns_trust_anchor_flush(DnsTrustAnchor *d) {
         assert(d);
 
         d->positive_by_key = hashmap_free_with_destructor(d->positive_by_key, dns_answer_unref);
-        d->revoked_by_rr = set_free_with_destructor(d->revoked_by_rr, dns_resource_record_unref);
+        d->revoked_by_rr = set_free(d->revoked_by_rr);
         d->negative_by_name = set_free(d->negative_by_name);
 }