From: Ronny Chevalier Date: Thu, 3 Mar 2016 17:15:24 +0000 (+0100) Subject: systemctl: add missing OOM check X-Git-Tag: v230~289^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F2790%2Fhead;p=thirdparty%2Fsystemd.git systemctl: add missing OOM check --- diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index c741baf58a2..a62f4bf2f5f 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. */