shared: allow to input empty string to config_parse_path()

Fixes #6633.
This commit is contained in:
Yu Watanabe 2017-09-05 15:12:55 +09:00
parent 499295fb46
commit 0fe5062975
1 changed files with 6 additions and 0 deletions

View File

@ -725,6 +725,11 @@ int config_parse_path(
assert(rvalue);
assert(data);
if (isempty(rvalue)) {
n = NULL;
goto finalize;
}
if (!utf8_is_valid(rvalue)) {
log_syntax_invalid_utf8(unit, LOG_ERR, filename, line, rvalue);
return fatal ? -ENOEXEC : 0;
@ -743,6 +748,7 @@ int config_parse_path(
path_kill_slashes(n);
finalize:
free(*s);
*s = n;