mirror of https://github.com/python/cpython.git
[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
|
@ -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…
Reference in New Issue