Merge sudo_module_register_loghandler and sudo_module_set_default_loghandler.
We now create the LogHandler class for each interpreter in python_plugin_init() instead of just once in sudo_module_init(). This fixes the crash seen in Py_EndInterpreter() with Python 3.12 and significantly reduces the number of leaked objects tracked by MemorySanitizer.
This commit is contained in:
@@ -542,8 +542,9 @@ python_plugin_init(struct PluginContext *plugin_ctx, char * const plugin_options
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (sudo_module_set_default_loghandler() < 0)
|
||||
if (sudo_module_set_default_loghandler() != SUDO_RC_OK) {
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (_python_plugin_set_path(plugin_ctx, _lookup_value(plugin_options, "ModulePath")) != SUDO_RC_OK) {
|
||||
goto cleanup;
|
||||
|
Reference in New Issue
Block a user