sudo_module_register_loghandler: clear sudo_type_LogHandler on error

Also add comments about PyModule_AddObject stealing a ref on success.
This commit is contained in:
Todd C. Miller
2023-07-22 08:33:04 -06:00
parent b52c32f234
commit 0462a4ee8c
4 changed files with 18 additions and 15 deletions

View File

@@ -74,6 +74,7 @@ sudo_module_register_baseplugin(PyObject *py_module)
goto cleanup;
}
// PyModule_AddObject steals a reference to py_class on success
Py_INCREF(py_class);
rc = SUDO_RC_OK;