From: Lennart Poettering Date: Thu, 21 Mar 2019 16:44:30 +0000 (+0100) Subject: systemctl: add missing OOM check X-Git-Tag: v242-rc1~81^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1dffbb91b2accb93962feecf44c4e9b07f06651;p=thirdparty%2Fsystemd.git systemctl: add missing OOM check --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 355e8421f50..965cbaaf338 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -6397,8 +6397,13 @@ static int enable_sysv_units(const char *verb, char **args) { log_info("%s is not a native service, redirecting to systemd-sysv-install.", name); } - if (!isempty(arg_root)) - argv[c++] = q = strappend("--root=", arg_root); + if (!isempty(arg_root)) { + q = strappend("--root=", arg_root); + if (!q) + return log_oom(); + + argv[c++] = q; + } argv[c++] = verb; argv[c++] = basename(p);