From: Yu Watanabe Date: Fri, 13 Jun 2025 14:46:26 +0000 (+0900) Subject: network: use the same hash ops used when allocated X-Git-Tag: v258-rc1~323^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=6ffc16dfd986fd3422c55c9723a837aa10158141;p=thirdparty%2Fsystemd.git network: use the same hash ops used when allocated Fixes #37830. --- 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; }