From d9219935aba4436363e0ed8acef5a4437463e602 Mon Sep 17 00:00:00 2001 From: Mike Yuan Date: Sat, 24 Feb 2024 08:55:33 +0800 Subject: [PATCH] systemctl-util: use strv_free_and_replace at one more place --- src/systemctl/systemctl-util.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index de6f53aafe..2dc92ce283 100644 --- a/src/systemctl/systemctl-util.c +++ b/src/systemctl/systemctl-util.c @@ -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) { -- 2.25.1