From 6ffc16dfd986fd3422c55c9723a837aa10158141 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 13 Jun 2025 23:46:26 +0900 Subject: [PATCH] network: use the same hash ops used when allocated Fixes #37830. --- src/network/networkd-link-bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/network/networkd-link-bus.c b/src/network/networkd-link-bus.c index bd477a2d1c5..297e1461bd4 100644 --- a/src/network/networkd-link-bus.c +++ b/src/network/networkd-link-bus.c @@ -506,12 +506,14 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v return sd_bus_error_setf(error, SD_BUS_ERROR_INVALID_ARGS, "Invalid negative trust anchor domain: %s", *i); } + /* The method accepts an empty strv, to override the negative trust anchors set in .network. + * Hence, we need to explicitly allocate an empty set here. */ ns = set_new(&dns_name_hash_ops_free); if (!ns) return -ENOMEM; STRV_FOREACH(i, ntas) { - r = set_put_strdup(&ns, *i); + r = set_put_strdup_full(&ns, &dns_name_hash_ops_free, *i); if (r < 0) return r; } -- 2.47.3