chiark / gitweb /
unit: split unit_printf() and friends into its own .c file
[elogind.git] / src / core / load-fragment.c
index 482d28b79587221dc2523532663350100f0b75be..0d5d841429aeaaae1a4212f05a06a44ff365d8ea 100644 (file)
@@ -42,6 +42,7 @@
 #include "securebits.h"
 #include "missing.h"
 #include "unit-name.h"
+#include "unit-printf.h"
 #include "bus-errors.h"
 #include "utf8.h"
 #include "path-util.h"
@@ -1469,7 +1470,7 @@ int config_parse_unit_condition_path(
         Unit *u = data;
         bool trigger, negate;
         Condition *c;
-        char *p;
+        _cleanup_free_ char *p = NULL;
 
         assert(filename);
         assert(lvalue);
@@ -1496,7 +1497,6 @@ int config_parse_unit_condition_path(
         c = condition_new(cond, p, trigger, negate);
         if (!c)
                 return -ENOMEM;
-        free(p);
 
         LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;
@@ -1516,7 +1516,7 @@ int config_parse_unit_condition_string(
         Unit *u = data;
         bool trigger, negate;
         Condition *c;
-        char *s;
+        _cleanup_free_ char *s = NULL;
 
         assert(filename);
         assert(lvalue);
@@ -1538,7 +1538,6 @@ int config_parse_unit_condition_string(
         c = condition_new(cond, s, trigger, negate);
         if (!c)
                 return log_oom();
-        free(s);
 
         LIST_PREPEND(Condition, conditions, u->conditions, c);
         return 0;