Fix missing Py_DECREF on mgr_module_type when the plugin module import fails.
This prevents a memory leak that occurs during subclass loading.
Signed-off-by: Nitzan Mordechai <nmordech@redhat.com>
error_string = peek_pyerror();
derr << "Module not found: '" << module_name << "'" << dendl;
derr << handle_pyerror(true, module_name, "PyModule::load_subclass_of") << dendl;
+ Py_DECREF(mgr_module_type);
return -ENOENT;
}
auto locals = PyModule_GetDict(plugin_module);