mirror of
https://github.com/python/cpython.git
synced 2026-01-06 15:32:22 +00:00
bpo-41604: Don't decrement the reference count of the previous user_ptr when set_panel_usertpr fails (GH-21933)
This commit is contained in:
parent
9073180db5
commit
3243e8a4b4
2 changed files with 5 additions and 1 deletions
|
|
@ -0,0 +1,2 @@
|
|||
Don't decrement the reference count of the previous user_ptr when
|
||||
set_panel_userptr fails.
|
||||
|
|
@ -456,7 +456,9 @@ _curses_panel_panel_set_userptr_impl(PyCursesPanelObject *self,
|
|||
/* In case of an ncurses error, decref the new object again */
|
||||
Py_DECREF(obj);
|
||||
}
|
||||
Py_XDECREF(oldobj);
|
||||
else {
|
||||
Py_XDECREF(oldobj);
|
||||
}
|
||||
|
||||
_curses_panel_state *state = PyType_GetModuleState(cls);
|
||||
return PyCursesCheckERR(state, rc, "set_panel_userptr");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue