]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
resolve: use set_put_strdup_full() to specify hash_ops
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 20:53:23 +0000 (05:53 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 20:58:33 +0000 (05:58 +0900)
src/resolve/resolved-link-bus.c
src/resolve/resolved-link.c

index 8b4e492e88481c87bd9e42ece1d4a22d9dffaac8..9c5f7a836ae1cbbb7dc26412cf14b38bbf17e1bf 100644 (file)
@@ -675,10 +675,6 @@ int bus_link_method_set_dnssec_negative_trust_anchors(sd_bus_message *message, v
         if (r < 0)
                 return r;
 
-        ns = set_new(&dns_name_hash_ops_free);
-        if (!ns)
-                return -ENOMEM;
-
         r = sd_bus_message_read_strv(message, &ntas);
         if (r < 0)
                 return r;
@@ -691,7 +687,7 @@ 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);
 
-                r = set_put_strdup(&ns, *i);
+                r = set_put_strdup_full(&ns, &dns_name_hash_ops_free, *i);
                 if (r < 0)
                         return r;
 
index 2a9d606bb41126fb52d370d95b14228c4140e397..1e2d95b4ea329ee18dd02e3f2988e0a4b8b0aa0b 100644 (file)
@@ -477,11 +477,7 @@ static int link_update_dnssec_negative_trust_anchors(Link *l) {
         if (r < 0)
                 return r;
 
-        ns = set_new(&dns_name_hash_ops_free);
-        if (!ns)
-                return -ENOMEM;
-
-        r = set_put_strdupv(&ns, ntas);
+        r = set_put_strdupv_full(&ns, &dns_name_hash_ops_free, ntas);
         if (r < 0)
                 return r;