From 8b7ec7bbfad40308848cfda8499f34a16449fc08 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Sat, 13 Oct 2018 14:34:56 +0200 Subject: [PATCH] systemctl: add missing OOM check --- src/systemctl/systemctl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index be1b7375afa..e319add8f8e 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -3070,9 +3070,11 @@ static int start_unit(int argc, char *argv[], void *userdata) { one_name = action_table[arg_action].target; } - if (one_name) + if (one_name) { names = strv_new(one_name, NULL); - else { + if (!names) + return log_oom(); + } else { r = expand_names(bus, strv_skip(argv, 1), suffix, &names); if (r < 0) return log_error_errno(r, "Failed to expand names: %m"); -- 2.47.3