]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/unit: use string_hash_ops_free for Unit.aliases
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Apr 2025 01:40:20 +0000 (10:40 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 13 Apr 2025 00:49:40 +0000 (09:49 +0900)
src/core/unit.c

index b8febd4a218d0891764924c9e8102b0f122f4690..557630368cc08f211b9bb975172b9520c1626dfc 100644 (file)
@@ -219,7 +219,7 @@ static int unit_add_alias(Unit *u, char *donated_name) {
 
         /* Make sure that u->names is allocated. We may leave u->names
          * empty if we fail later, but this is not a problem. */
-        r = set_ensure_put(&u->aliases, &string_hash_ops, donated_name);
+        r = set_ensure_put(&u->aliases, &string_hash_ops_free, donated_name);
         if (r < 0)
                 return r;
         assert(r > 0);
@@ -860,7 +860,7 @@ Unit* unit_free(Unit *u) {
 
         free(u->access_selinux_context);
 
-        set_free_free(u->aliases);
+        set_free(u->aliases);
         free(u->id);
 
         activation_details_unref(u->activation_details);
@@ -905,7 +905,7 @@ static int unit_merge_names(Unit *u, Unit *other) {
         }
 
         TAKE_PTR(other->id);
-        other->aliases = set_free_free(other->aliases);
+        other->aliases = set_free(other->aliases);
 
         SET_FOREACH(name, u->aliases)
                 assert_se(hashmap_replace(u->manager->units, name, u) == 0);