mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.9] bpo-41604: Don't decrement the reference count of the previous user_ptr when set_panel_usertpr fails (GH-21933). (GH-24403)
(cherry picked from commit 3243e8a4b4)
Co-authored-by: Anonymous Maarten <madebr@users.noreply.github.com>
This commit is contained in:
parent
e9d4960d15
commit
3c8d693443
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.
|
||||
|
|
@ -440,7 +440,9 @@ _curses_panel_panel_set_userptr(PyCursesPanelObject *self, PyObject *obj)
|
|||
/* In case of an ncurses error, decref the new object again */
|
||||
Py_DECREF(obj);
|
||||
}
|
||||
Py_XDECREF(oldobj);
|
||||
else {
|
||||
Py_XDECREF(oldobj);
|
||||
}
|
||||
return PyCursesCheckERR(rc, "set_panel_userptr");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue