summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorRoss Lagerwall <rosslagerwall@gmail.com>2012-09-07 06:34:23 (GMT)
committerRoss Lagerwall <rosslagerwall@gmail.com>2012-09-07 06:34:23 (GMT)
commit2dabaf63cf165dce61edbd51edfa5510348371bf (patch)
tree897b23009399007c8caba9881fd0ffa468a0ca50 /Modules
parent4e2514031afe4ee2d9ea619d09150ccd77e61f3c (diff)
downloadcpython-2dabaf63cf165dce61edbd51edfa5510348371bf.zip
cpython-2dabaf63cf165dce61edbd51edfa5510348371bf.tar.gz
cpython-2dabaf63cf165dce61edbd51edfa5510348371bf.tar.bz2
Issue #15876: Fix a refleak in the curses module
The refleak occurred when assigning to window.encoding.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_cursesmodule.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_cursesmodule.c b/Modules/_cursesmodule.c
index 3f9ca13..4e1449b 100644
--- a/Modules/_cursesmodule.c
+++ b/Modules/_cursesmodule.c
@@ -1938,6 +1938,7 @@ PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value)
if (ascii == NULL)
return -1;
encoding = strdup(PyBytes_AS_STRING(ascii));
+ Py_DECREF(ascii);
if (encoding == NULL) {
PyErr_NoMemory();
return -1;