]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
depmod: fix leak on error path
authorLucas De Marchi <lucas.demarchi@intel.com>
Fri, 24 Feb 2017 05:47:37 +0000 (21:47 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 24 Feb 2017 07:18:02 +0000 (23:18 -0800)
tools/depmod.c

index dea60eaff8efb3c97bc60fe4bc410e0d5b67963e..116adbeb14a0f53aa1821e446518c52cbce17be1 100644 (file)
@@ -1631,7 +1631,7 @@ static void depmod_report_cycles(struct depmod *depmod, uint16_t n_mods,
        size_t n_r; /* local n_roots */
        int i;
        int err;
-       void **stack;
+       _cleanup_free_ void **stack = NULL;
        struct mod *m;
        struct mod *root;
        struct hash *loop_set;
@@ -1675,6 +1675,7 @@ static void depmod_report_cycles(struct depmod *depmod, uint16_t n_mods,
 
        num_cyclic = hash_get_count(loop_set);
        ERR("Found %d modules in dependency cycles!\n", num_cyclic);
+
 err:
        hash_free(loop_set);
 }