mirror of
https://github.com/python/cpython
synced 2026-09-28 05:28:18 +03:00
gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767)
This commit is contained in:
parent
e1c295e3da
commit
745492355b
4 changed files with 37 additions and 55 deletions
|
|
@ -662,8 +662,7 @@ _curses_panel_exec(PyObject *mod)
|
|||
state->PyCursesError = PyErr_NewException(
|
||||
"_curses_panel.error", NULL, NULL);
|
||||
|
||||
if (PyModule_AddObject(mod, "error", Py_NewRef(state->PyCursesError)) < 0) {
|
||||
Py_DECREF(state->PyCursesError);
|
||||
if (PyModule_AddObjectRef(mod, "error", state->PyCursesError) < 0) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue