systemctl: add missing OOM check

This commit is contained in:
Lennart Poettering
2019-03-21 18:10:06 +01:00
parent 3483460cb8
commit b1dffbb91b
+7 -2
View File
@@ -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);