mirror of
https://github.com/AuxXxilium/kmod.git
synced 2024-12-26 21:35:26 +07:00
Remove module from hash when it's gone
Module was never being removed from hash table. Therefore, if we create a module, unref it and create it again we will access freed memory. Commit "53385cf Improve test of double references" introduced a new test in test-mod-double-ref.c that previously to this commit was crashing and now it's working fine.
This commit is contained in:
parent
22907a188c
commit
4084c176c1
@ -392,6 +392,7 @@ KMOD_EXPORT struct kmod_module *kmod_module_unref(struct kmod_module *mod)
|
||||
|
||||
DBG(mod->ctx, "kmod_module %p released\n", mod);
|
||||
|
||||
kmod_pool_del_module(mod->ctx, mod, mod->hashkey);
|
||||
kmod_module_unref_list(mod->dep);
|
||||
kmod_unref(mod->ctx);
|
||||
free(mod->options);
|
||||
|
Loading…
Reference in New Issue
Block a user