conf-parser: minor coding style improvements

This commit is contained in:
Lennart Poettering 2016-07-14 12:24:59 +02:00
parent 8d36b53a2d
commit 00d0fd0619
1 changed files with 4 additions and 2 deletions

View File

@ -708,6 +708,7 @@ int config_parse_strv(const char *unit,
void *userdata) {
char ***sv = data;
int r;
assert(filename);
assert(lvalue);
@ -721,18 +722,19 @@ int config_parse_strv(const char *unit,
* we actually fill in a real empty array here rather
* than NULL, since some code wants to know if
* something was set at all... */
empty = strv_new(NULL, NULL);
empty = new0(char*, 1);
if (!empty)
return log_oom();
strv_free(*sv);
*sv = empty;
return 0;
}
for (;;) {
char *word = NULL;
int r;
r = extract_first_word(&rvalue, &word, WHITESPACE, EXTRACT_QUOTES|EXTRACT_RETAIN_ESCAPE);
if (r == 0)
break;