]> git.ipfire.org Git - thirdparty/kmod.git/commit
module: fix a memory leak
authorBartosz Golaszewski <bgolaszewski@baylibre.com>
Wed, 15 Feb 2017 11:18:03 +0000 (12:18 +0100)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 16 Feb 2017 16:50:01 +0000 (08:50 -0800)
commitb1982674ae994b6ceda36dbee3fba3b2a6ba10de
tree54c0f30d47094fdc2bcc8fc7d79fa06d70611743
parentded0bebca80ac1f20caa488efb412aa72ea8a7fd
module: fix a memory leak

When a module is removed and re-inserted without unrefing, the
kmod_file is unconditionally re-opened. This results in a memory
and file descriptor leak.

Fix it by checking if the file is already open in
kmod_module_insert_module().

Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
libkmod/libkmod-module.c