chiark / gitweb /
conf-parser: fix memleak (#9177)
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Jun 2018 12:18:28 +0000 (21:18 +0900)
committerSven Eden <yamakuzure@gmx.net>
Fri, 24 Aug 2018 14:47:08 +0000 (16:47 +0200)
Fixes CID#1391437.

Closes #9180.

src/shared/conf-parser.c

index a43e595cc190a8f796a38939ce20e6257fd7a620..c875a67715051b943285e2c11045fb87719c5565 100644 (file)
@@ -46,6 +46,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,
@@ -728,8 +729,9 @@ int config_parse_path(
                 void *data,
                 void *userdata) {
 
-        char **s = data, *n;
+        _cleanup_free_ char *n = NULL;
         bool fatal = ltype;
+        char **s = data;
         int r;
 
         assert(filename);