From 043717f9d3c75e0ac2621f76362f6025443f0de9 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Thu, 3 Mar 2016 18:15:24 +0100 Subject: systemctl: add missing OOM check --- src/systemctl/systemctl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. */ -- cgit v1.2.3-54-g00ecf