diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-06-04 21:27:57 +0900 |
---|---|---|
committer | Sven Eden <yamakuzure@gmx.net> | 2018-08-24 16:47:08 +0200 |
commit | d15590d95222526bf9eecfe8d0b8485b51e018c6 (patch) | |
tree | 004d97c1f63f0460b4cb4885803a4d597bb81d72 /src | |
parent | 54a443dd8b21fc59a043f63f17e6db2d419cdacb (diff) |
conf-parser: simplify conf_parse_path()
Follow-up for 97651797e83d0548aef9f808657d3518d89e5aee.
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/conf-parser.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c index 133d8f62c..db74a7fdb 100644 --- a/src/shared/conf-parser.c +++ b/src/shared/conf-parser.c @@ -49,6 +49,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, @@ -741,10 +742,8 @@ int config_parse_path( assert(rvalue); assert(data); - if (isempty(rvalue)) { - n = NULL; + if (isempty(rvalue)) goto finalize; - } n = strdup(rvalue); if (!n) @@ -755,9 +754,7 @@ int config_parse_path( return fatal ? -ENOEXEC : 0; finalize: - free_and_replace(*s, n); - - return 0; + return free_and_replace(*s, n); } int config_parse_strv( |