summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-04 00:30:36 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2018-06-04 00:30:42 +0900
commit97b9c506cf07be74c5771fc624c1e8bb05fd2eab (patch)
treec6f25ce5b5f0c91a4717cfa77c601d2b06fa9ce6
parent78d17fa09983cb1300c9a68ad657ce3949204ec1 (diff)
downloadsystemd-97b9c506cf07be74c5771fc624c1e8bb05fd2eab.tar.gz
conf-parse: use free_and_replace()
Also removes unnecessary empty lines.
-rw-r--r--src/shared/conf-parser.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 159b923e9c..1057c59a11 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -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;
-
}
}