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>
1 file changed
tree: 54c0f30d47094fdc2bcc8fc7d79fa06d70611743
  1. libkmod/
  2. m4/
  3. man/
  4. shared/
  5. shell-completion/
  6. testsuite/
  7. tools/
  8. .gitignore
  9. .travis.yml
  10. bootstrap
  11. bootstrap-configure
  12. CODING-STYLE
  13. configure.ac
  14. COPYING
  15. Makefile.am
  16. NEWS
  17. README
  18. README.md
  19. TODO
README.md

kmod - Linux kernel module handling

Build Status
Coverity Scan Status

This is a mirror only. Please see README file for more information.