]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/unit: use the same hash_ops originally used on allocation
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 19:59:37 +0000 (04:59 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 7 May 2025 20:58:33 +0000 (05:58 +0900)
See unit_file_build_name_map().

src/core/unit.c

index d057b8ddc9faedc4bdcf519c04359227c22f84da..c706caae08c682491704b7c9c4f2c6aaa9e66788 100644 (file)
@@ -4629,7 +4629,7 @@ int unit_write_setting(Unit *u, UnitWriteFlags flags, const char *name, const ch
         /* Make sure the drop-in dir is registered in our path cache. This way we don't need to stupidly
          * recreate the cache after every drop-in we write. */
         if (u->manager->unit_path_cache) {
-                r = set_put_strdup(&u->manager->unit_path_cache, p);
+                r = set_put_strdup_full(&u->manager->unit_path_cache, &path_hash_ops_free, p);
                 if (r < 0)
                         return r;
         }