]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl-util: use strv_free_and_replace at one more place
authorMike Yuan <me@yhndnzj.com>
Sat, 24 Feb 2024 00:55:33 +0000 (08:55 +0800)
committerMike Yuan <me@yhndnzj.com>
Sat, 24 Feb 2024 04:07:32 +0000 (12:07 +0800)
src/systemctl/systemctl-util.c

index de6f53aafe64a789fde630ca1c4c8b90b049860d..2dc92ce283e08823151a12eaeb1cf0955b34b330 100644 (file)
@@ -762,9 +762,7 @@ int maybe_extend_with_unit_dependencies(sd_bus *bus, char ***list) {
         if (r < 0)
                 return log_error_errno(r, "Failed to append unit dependencies: %m");
 
-        strv_free(*list);
-        *list = TAKE_PTR(list_with_deps);
-        return 0;
+        return strv_free_and_replace(*list, list_with_deps);
 }
 
 int unit_get_dependencies(sd_bus *bus, const char *name, char ***ret) {