summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-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.
*/