summaryrefslogtreecommitdiff
path: root/src/systemctl/systemctl.c
diff options
context:
space:
mode:
authorRonny Chevalier <chevalier.ronny@gmail.com>2016-03-03 18:15:24 +0100
committerRonny Chevalier <chevalier.ronny@gmail.com>2016-03-03 18:16:31 +0100
commit043717f9d3c75e0ac2621f76362f6025443f0de9 (patch)
tree40cdd6071d61bd516bfbc06910b222948c9d4427 /src/systemctl/systemctl.c
parent04c760d2fe8615203993829f7724f7e6ba553340 (diff)
systemctl: add missing OOM check
Diffstat (limited to 'src/systemctl/systemctl.c')
-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.
*/