summaryrefslogtreecommitdiff
path: root/src/login
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-23 10:12:25 +0200
committerLennart Poettering <lennart@poettering.net>2019-07-23 16:08:06 +0200
commit1b5e34fe96975d3b9a7811e986dfdbef50232217 (patch)
treecfc6465f63b541ab409c4bc1f368cf0048b14019 /src/login
parent0eebcd4c68eab796a07c127a8659e72253bce2cb (diff)
downloadsystemd-1b5e34fe96975d3b9a7811e986dfdbef50232217.tar.gz
logind: add missing OOM check in client tool
Diffstat (limited to 'src/login')
-rw-r--r--src/login/inhibit.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index d96c8195a2..25ff4d0be6 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -284,7 +284,6 @@ static int run(int argc, char *argv[]) {
if (arg_action == ACTION_LIST)
return print_inhibitors(bus);
-
else {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
_cleanup_strv_free_ char **arguments = NULL;
@@ -295,8 +294,13 @@ static int run(int argc, char *argv[]) {
/* Ignore SIGINT and allow the forked process to receive it */
(void) ignore_signals(SIGINT, -1);
- if (!arg_who)
- arg_who = w = strv_join(argv + optind, " ");
+ if (!arg_who) {
+ w = strv_join(argv + optind, " ");
+ if (!w)
+ return log_oom();
+
+ arg_who = w;
+ }
if (!arg_mode)
arg_mode = "block";