From: Lennart Poettering Date: Fri, 15 Mar 2019 09:42:46 +0000 (+0100) Subject: systemctl: use strv_consume() where we can X-Git-Tag: v242-rc1~95^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12052%2Fhead;p=thirdparty%2Fsystemd.git systemctl: use strv_consume() where we can --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 637985bcda2..dd51b1912e5 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -8073,10 +8073,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) { if (r == 0) break; - if (strv_push(&arg_properties, prop) < 0) + if (strv_consume(&arg_properties, TAKE_PTR(prop)) < 0) return log_oom(); - - prop = NULL; } } @@ -8302,10 +8300,8 @@ static int systemctl_parse_argv(int argc, char *argv[]) { return 0; } - if (strv_push(&arg_states, s) < 0) + if (strv_consume(&arg_states, TAKE_PTR(s)) < 0) return log_oom(); - - s = NULL; } break; }