From 320078081333da8fc62e2db0bdcddfaebf30cf31 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Thu, 23 Feb 2017 21:47:37 -0800 Subject: depmod: fix leak on error path --- tools/depmod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- cgit v1.2.3