conf-parse: use free_and_replace()

Also removes unnecessary empty lines.
This commit is contained in:
Yu Watanabe
2018-06-04 00:30:42 +09:00
parent 78d17fa099
commit 97b9c506cf
+1 -4
View File
@@ -240,8 +240,7 @@ static int parse_line(
*section_line = 0;
*section_ignored = true;
} else {
free(*section);
*section = n;
free_and_replace(*section, n);
*section_line = line;
*section_ignored = false;
}
@@ -399,7 +398,6 @@ int config_parse(const char *unit,
if (flags & CONFIG_PARSE_WARN)
log_warning_errno(r, "%s:%u: Failed to parse file: %m", filename, line);
return r;
}
continuation = mfree(continuation);
@@ -422,7 +420,6 @@ int config_parse(const char *unit,
if (flags & CONFIG_PARSE_WARN)
log_warning_errno(r, "%s:%u: Failed to parse file: %m", filename, line);
return r;
}
}