chiark / gitweb /
conf-parser: simplify conf_parse_path()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Jun 2018 12:27:57 +0000 (21:27 +0900)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
Follow-up for 97651797e83d0548aef9f808657d3518d89e5aee.

src/shared/conf-parser.c

index 133d8f62c60b968f7eb5cfb96882793a105aa159..db74a7fdb61f487b1ef63ce0b37333f243092df7 100644 (file)
@@ -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(