summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas De Marchi <lucas.demarchi@intel.com>2017-02-23 21:47:37 -0800
committerLucas De Marchi <lucas.demarchi@intel.com>2017-02-23 23:18:02 -0800
commit320078081333da8fc62e2db0bdcddfaebf30cf31 (patch)
tree8b79e26b73727832d1371129d9eb33bbd2a5d453
parent72167ba113c00eea6eb73cd91ce173e5c734564b (diff)
downloadkmod-320078081333da8fc62e2db0bdcddfaebf30cf31.tar.gz
kmod-320078081333da8fc62e2db0bdcddfaebf30cf31.tar.bz2
kmod-320078081333da8fc62e2db0bdcddfaebf30cf31.zip
depmod: fix leak on error path
-rw-r--r--tools/depmod.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/depmod.c b/tools/depmod.c
index dea60ea..116adbe 100644
--- a/tools/depmod.c
+++ b/tools/depmod.c
@@ -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);
}