summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-03 12:32:12 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-03-03 12:32:12 -0500
commit9f0cd100d0dbc7c9b55e99bacb4034402a60b389 (patch)
tree40cdd6071d61bd516bfbc06910b222948c9d4427
parent04c760d2fe8615203993829f7724f7e6ba553340 (diff)
parent043717f9d3c75e0ac2621f76362f6025443f0de9 (diff)
Merge pull request #2790 from ronnychevalier/rc/systemctl_missing_oom_check
systemctl: add missing OOM check
-rw-r--r--src/systemctl/systemctl.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index c741baf58a..a62f4bf2f5 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -6167,7 +6167,12 @@ end:
/* Removing empty dropin dirs */
if (!arg_full) {
- _cleanup_free_ char *dir = dirname_malloc(*original);
+ _cleanup_free_ char *dir;
+
+ dir = dirname_malloc(*original);
+ if (!dir)
+ return log_oom();
+
/* no need to check if the dir is empty, rmdir
* does nothing if it is not the case.
*/