diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-08 21:14:22 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2016-05-08 21:14:22 (GMT) |
commit | 6a8af9ab36aaa18308f5f742a81035d7d9e41b5e (patch) | |
tree | 74c0752bb149252573bc2d87b76900615bab8d84 /Modules/_curses_panel.c | |
parent | 3e99fdeed5cff4eda913ea0082cdb94e59ce629d (diff) | |
parent | df40b623904c78847bbe24b9604a5b0522eafdb9 (diff) | |
download | cpython-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.c | 5 |
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); |