From: Lucas De Marchi Date: Fri, 24 Feb 2017 05:47:37 +0000 (-0800) Subject: depmod: fix leak on error path X-Git-Tag: v24~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=320078081333da8fc62e2db0bdcddfaebf30cf31;p=thirdparty%2Fkmod.git depmod: fix leak on error path --- diff --git a/tools/depmod.c b/tools/depmod.c index dea60eaf..116adbeb 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); }