diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-08 21:11:59 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-08 21:11:59 (GMT) |
commit | df40b623904c78847bbe24b9604a5b0522eafdb9 (patch) | |
tree | 540a9469dd19118f3f2ac492afe282f2ffc7f830 /Modules/_curses_panel.c | |
parent | 02d9f5e5b2ee2662cb6776ebdafa2f3169452e41 (diff) | |
download | cpython-df40b623904c78847bbe24b9604a5b0522eafdb9.zip cpython-df40b623904c78847bbe24b9604a5b0522eafdb9.tar.gz cpython-df40b623904c78847bbe24b9604a5b0522eafdb9.tar.bz2 |
Issue #25745: Fixed leaking a userptr in curses panel destructor.
Diffstat (limited to 'Modules/_curses_panel.c')
-rw-r--r-- | Modules/_curses_panel.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c index c77e614..228f497 100644 --- a/Modules/_curses_panel.c +++ b/Modules/_curses_panel.c @@ -220,6 +220,11 @@ PyCursesPanel_New(PANEL *pan, PyCursesWindowObject *wo) static void PyCursesPanel_Dealloc(PyCursesPanelObject *po) { + PyObject *obj = (PyObject *) panel_userptr(po->pan); + if (obj) { + (void)set_panel_userptr(po->pan, NULL); + Py_DECREF(obj); + } (void)del_panel(po->pan); if (po->wo != NULL) { Py_DECREF(po->wo); |