Work around a crash with Python 3.12.

In sudo_module_set_default_loghandler() if we don't leak the reference
to py_loghandler we get a crash in Py_EndInterpreter() with Python
3.12.  This probably indicates a reference counting bug elsewhere.
This commit is contained in:
Todd C. Miller
2023-07-21 12:20:18 -06:00
parent 91ea599459
commit 4e6254fea2

View File

@@ -187,7 +187,11 @@ cleanup:
Py_CLEAR(py_result);
Py_CLEAR(py_logger);
Py_CLEAR(py_logging_module);
#if 0
// XXX - If we don't leak py_loghandler here we may get a crash in
// Py_EndInterpreter() on Python 3.12.
Py_CLEAR(py_loghandler);
#endif
debug_return_int(PyErr_Occurred() ? SUDO_RC_ERROR : SUDO_RC_OK);
}