From: Yu Watanabe Date: Fri, 11 Apr 2025 01:40:20 +0000 (+0900) Subject: core/unit: use string_hash_ops_free for Unit.aliases X-Git-Tag: v258-rc1~825^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c6ea302097c1a18f96866cd31c5008927c0b4b0;p=thirdparty%2Fsystemd.git core/unit: use string_hash_ops_free for Unit.aliases --- diff --git a/src/core/unit.c b/src/core/unit.c index b8febd4a218..557630368cc 100644 --- a/src/core/unit.c +++ b/src/core/unit.c @@ -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);