From: Mike Yuan Date: Sat, 24 Feb 2024 00:55:33 +0000 (+0800) Subject: systemctl-util: use strv_free_and_replace at one more place X-Git-Tag: v256-rc1~746^2~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d9219935aba4436363e0ed8acef5a4437463e602;p=thirdparty%2Fsystemd.git systemctl-util: use strv_free_and_replace at one more place --- diff --git a/src/systemctl/systemctl-util.c b/src/systemctl/systemctl-util.c index de6f53aafe6..2dc92ce283e 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) {