chiark / gitweb /
core/execute: only clean the environment, if we have one
[elogind.git] / src / core / load-fragment.c
index 2a21727c6c89ad0387a3c9bf69f1d0e7ec70dc80..e71194301d1a619925fe1d0c2b9a8a4c676a4fb8 100644 (file)
@@ -46,7 +46,7 @@
 #include "missing.h"
 #include "unit-name.h"
 #include "unit-printf.h"
-#include "bus-errors.h"
+#include "dbus-common.h"
 #include "utf8.h"
 #include "path-util.h"
 #include "syscall-list.h"
@@ -1314,7 +1314,7 @@ int config_parse_path_spec(const char *unit,
         Path *p = data;
         PathSpec *s;
         PathType b;
-        char *k;
+        char _cleanup_free_ *k = NULL;
 
         assert(filename);
         assert(lvalue);
@@ -1348,17 +1348,15 @@ int config_parse_path_spec(const char *unit,
         if (!path_is_absolute(k)) {
                 log_syntax(unit, LOG_ERR, filename, line, EINVAL,
                            "Path is not absolute, ignoring: %s", k);
-                free(k);
                 return 0;
         }
 
         s = new0(PathSpec, 1);
-        if (!s) {
-                free(k);
+        if (!s)
                 return log_oom();
-        }
 
         s->path = path_kill_slashes(k);
+        k = NULL;
         s->type = b;
         s->inotify_fd = -1;