mirror of
https://github.com/python/cpython
synced 2026-09-29 10:35:30 +03:00
Issue #15876: Fix a refleak in the curses module
The refleak occurred when assigning to window.encoding.
This commit is contained in:
parent
4e2514031a
commit
2dabaf63cf
2 changed files with 3 additions and 0 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue