]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
systemctl: add missing OOM check 2790/head
authorRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 3 Mar 2016 17:15:24 +0000 (18:15 +0100)
committerRonny Chevalier <chevalier.ronny@gmail.com>
Thu, 3 Mar 2016 17:16:31 +0000 (18:16 +0100)
src/systemctl/systemctl.c

index c741baf58a20bcda5fe0396a67763fcaab1b0ab2..a62f4bf2f5fc6bc630922e5d08671059b651e4df 100644 (file)
@@ -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.
                          */