summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2018-06-04 00:30:36 +0900
committerSven Eden <yamakuzure@gmx.net>2018-08-24 16:47:08 +0200
commit89536a0994568908cb905b9dda7497e02bf1f070 (patch)
tree79f4a6da5c50a797c68cc0c7539cce62f4e443d8
parentf1fd9a252b3c72b10c849846ef929b0a727feeed (diff)
conf-parse: use free_and_replace()
Also removes unnecessary empty lines.
-rw-r--r--src/shared/conf-parser.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 32d26c36d..96bcddb4f 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -44,6 +44,7 @@
//#include "rlimit-util.h"
//#include "rlimit-util.h"
//#include "rlimit-util.h"
+//#include "rlimit-util.h"
int config_item_table_lookup(
const void *table,
@@ -250,8 +251,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;
}
@@ -409,7 +409,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);
@@ -432,7 +431,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;
-
}
}