tests: Fix use-after-free bug
This commit is contained in:
parent
17809d2db7
commit
493f729efc
1 changed files with 4 additions and 1 deletions
|
@ -100,10 +100,13 @@ void ircd_util_init(const char *name)
|
||||||
void ircd_util_reload_module(const char *name)
|
void ircd_util_reload_module(const char *name)
|
||||||
{
|
{
|
||||||
struct module *mod = findmodule_byname(name);
|
struct module *mod = findmodule_byname(name);
|
||||||
|
int origin, core;
|
||||||
|
|
||||||
if (ok(mod != NULL, MSG)) {
|
if (ok(mod != NULL, MSG)) {
|
||||||
|
origin = mod->origin;
|
||||||
|
core = mod->core;
|
||||||
if (ok(unload_one_module(name, false), MSG)) {
|
if (ok(unload_one_module(name, false), MSG)) {
|
||||||
ok(load_one_module(name, mod->origin, mod->core), MSG);
|
ok(load_one_module(name, origin, core), MSG);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue