projects
/
platform
/
upstream
/
systemd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3483460
)
systemctl: add missing OOM check
author
Lennart Poettering
<lennart@poettering.net>
Thu, 21 Mar 2019 16:44:30 +0000
(17:44 +0100)
committer
Lennart Poettering
<lennart@poettering.net>
Thu, 21 Mar 2019 17:10:06 +0000
(18:10 +0100)
src/systemctl/systemctl.c
patch
|
blob
|
history
diff --git
a/src/systemctl/systemctl.c
b/src/systemctl/systemctl.c
index
355e842
..
965cbaa
100644
(file)
--- 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);