]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core/unit: fix logic of dropping self-referencing dependencies
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 15 Nov 2022 14:08:35 +0000 (23:08 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 6 Dec 2022 08:49:31 +0000 (17:49 +0900)
Fixes a bug in 15ed3c3a188cf7fa5a60ae508fc7a3ed048d2220.

src/core/unit.c

index 1a580157afa4938264e9bcc4b4b95e75f3ebd2d4..a9052428e4748ed25e30ceb3d22d02527ce6fc75 100644 (file)
@@ -1131,10 +1131,11 @@ static void unit_merge_dependencies(Unit *u, Unit *other) {
                         }
                 } else {
                         assert_se(r >= 0);
-                        TAKE_PTR(other_deps);
 
                         if (hashmap_remove(other_deps, u))
                                 unit_maybe_warn_about_dependency(u, other->id, UNIT_DEPENDENCY_FROM_PTR(dt));
+
+                        TAKE_PTR(other_deps);
                 }
         }