chiark / gitweb /
move _cleanup_ attribute in front of the type
[elogind.git] / src / core / load-fragment.c
index 2a21727c6c89ad0387a3c9bf69f1d0e7ec70dc80..c3f4f926114cbf58451f5ebc4b7b8469fb296ce4 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"
@@ -91,7 +91,7 @@ int config_parse_unit_deps(const char* unit,
         assert(rvalue);
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char _cleanup_free_ *t = NULL, *k = NULL;
+                _cleanup_free_ char *t = NULL, *k = NULL;
                 int r;
 
                 t = strndup(w, l);
@@ -785,7 +785,7 @@ int config_parse_exec_cpu_affinity(const char *unit,
         }
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char _cleanup_free_ *t = NULL;
+                _cleanup_free_ char *t = NULL;
                 int r;
                 unsigned cpu;
 
@@ -927,7 +927,7 @@ int config_parse_bounding_set(const char *unit,
          * interface. */
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char _cleanup_free_ *t = NULL;
+                _cleanup_free_ char *t = NULL;
                 int r;
                 cap_value_t cap;
 
@@ -1019,7 +1019,7 @@ int config_parse_unit_cgroup(const char *unit,
         }
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char _cleanup_free_ *t = NULL, *k = NULL, *ku = NULL;
+                _cleanup_free_ char *t = NULL, *k = NULL, *ku = NULL;
                 int r;
 
                 t = strndup(w, l);
@@ -1161,7 +1161,7 @@ int config_parse_exec_mount_flags(const char *unit,
         assert(data);
 
         FOREACH_WORD_SEPARATOR(w, l, rvalue, ", ", state) {
-                char _cleanup_free_ *t;
+                _cleanup_free_ char *t;
 
                 t = strndup(w, l);
                 if (!t)
@@ -1314,7 +1314,7 @@ int config_parse_path_spec(const char *unit,
         Path *p = data;
         PathSpec *s;
         PathType b;
-        char *k;
+        _cleanup_free_ char *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;
 
@@ -1482,7 +1480,7 @@ int config_parse_service_sockets(const char *unit,
         assert(data);
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
-                char _cleanup_free_ *t = NULL, *k = NULL;
+                _cleanup_free_ char *t = NULL, *k = NULL;
 
                 t = strndup(w, l);
                 if (!t)
@@ -2076,7 +2074,7 @@ int config_parse_syscall_filter(const char *unit,
 
         FOREACH_WORD_QUOTED(w, l, rvalue, state) {
                 int id;
-                char _cleanup_free_ *t = NULL;
+                _cleanup_free_ char *t = NULL;
 
                 t = strndup(w, l);
                 if (!t)