summaryrefslogtreecommitdiffstats
path: root/Modules/_curses_panel.c
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-05-08 21:14:22 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-05-08 21:14:22 (GMT)
commit6a8af9ab36aaa18308f5f742a81035d7d9e41b5e (patch)
tree74c0752bb149252573bc2d87b76900615bab8d84 /Modules/_curses_panel.c
parent3e99fdeed5cff4eda913ea0082cdb94e59ce629d (diff)
parentdf40b623904c78847bbe24b9604a5b0522eafdb9 (diff)
downloadcpython-6a8af9ab36aaa18308f5f742a81035d7d9e41b5e.zip
cpython-6a8af9ab36aaa18308f5f742a81035d7d9e41b5e.tar.gz
cpython-6a8af9ab36aaa18308f5f742a81035d7d9e41b5e.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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/_curses_panel.c b/Modules/_curses_panel.c
index bd31326..18ef335 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);