]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sysv-generator: fix mem leaks
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 11 Apr 2015 11:45:46 +0000 (13:45 +0200)
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>
Sat, 11 Apr 2015 11:47:56 +0000 (13:47 +0200)
src/sysv-generator/sysv-generator.c

index 4beea4dd02ed9a4d4332166713680d34e1ff86db..e5141c7430f089613cfe3d1a177e1519c518cc4a 100644 (file)
@@ -793,7 +793,7 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
         char **p;
         unsigned i;
         _cleanup_closedir_ DIR *d = NULL;
-        _cleanup_free_ char *path = NULL, *fpath = NULL, *name = NULL;
+        _cleanup_free_ char *path = NULL, *fpath = NULL;
         SysvStub *service;
         Iterator j;
         Set *runlevel_services[ELEMENTSOF(rcnd_table)] = {};
@@ -821,6 +821,8 @@ static int set_dependencies_from_rcnd(const LookupPaths *lp, Hashmap *all_servic
                         }
 
                         while ((de = readdir(d))) {
+                                _cleanup_free_ char *name = NULL;
+
                                 int a, b;
 
                                 if (hidden_file(de->d_name))
@@ -978,5 +980,7 @@ int main(int argc, char *argv[]) {
                         continue;
         }
 
+        lookup_paths_free(&lp);
+
         return EXIT_SUCCESS;
 }