Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 2dabaf6

Browse files
committed
Issue #15876: Fix a refleak in the curses module
The refleak occurred when assigning to window.encoding.
1 parent 4e25140 commit 2dabaf6

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ Core and Builtins
2626
Library
2727
-------
2828

29+
- Issue #15876: Fix a refleak in the curses module: window.encoding.
30+
2931
- Issue #15841: The readable(), writable() and seekable() methods of BytesIO
3032
and StringIO objects now raise ValueError when the object has been closed.
3133
Patch by Alessandro Moura.

Modules/_cursesmodule.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1938,6 +1938,7 @@ PyCursesWindow_set_encoding(PyCursesWindowObject *self, PyObject *value)
19381938
if (ascii == NULL)
19391939
return -1;
19401940
encoding = strdup(PyBytes_AS_STRING(ascii));
1941+
Py_DECREF(ascii);
19411942
if (encoding == NULL) {
19421943
PyErr_NoMemory();
19431944
return -1;

0 commit comments

Comments
 (0)