]> git.ipfire.org Git - thirdparty/kmod.git/commit
depmod: use cleanup attribute to simplify free on exit
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 25 Feb 2015 15:06:44 +0000 (12:06 -0300)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 25 Feb 2015 15:06:44 +0000 (12:06 -0300)
commita07ea0329ca9655531f624b46719984da4604fbc
treeff5ff0838076d8c801816b8fea2977ccce865b46
parent0b3aef23b8e5cc935caaec6230782553c1a4ca95
depmod: use cleanup attribute to simplify free on exit

Reusing the root variable was a bad idea. Doing so we could call free()
on a variable that was not allocated. For example: "depmod -b / -h".
Since we would jump to cmdline_failed, root would not be duplicated.

Instead of fighting the order in the options, just used the cleanup
attribute and remove the calls to free() on "config_paths" and "root".
tools/depmod.c