With the upcoming patches, removing exit() usage, ASan started reporting
that our test leaks kmod_module handles.
Resolve those leaks - we shouldn't be doing that in the normal (success)
path.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/371
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
ERR("could not insert module: %s\n", strerror(-err));
exit(EXIT_FAILURE);
}
+ kmod_module_unref(mod);
kmod_unref(ctx);
exit(EXIT_SUCCESS);
exit(EXIT_FAILURE);
}
+ kmod_module_unref(mod_bla);
+ kmod_module_unref(mod_simple);
kmod_unref(ctx);
exit(EXIT_SUCCESS);