Commit 96d80129 authored by Serhiy Storchaka's avatar Serhiy Storchaka

Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.

parent 07e03ab9
......@@ -2338,12 +2338,9 @@ textiowrapper_tell(textio *self, PyObject *args)
PyErr_Fetch(&type, &value, &traceback);
res = PyObject_CallMethod(self->decoder, "setstate", "(O)", saved_state);
_PyErr_ReplaceException(type, value, traceback);
Py_DECREF(saved_state);
if (res == NULL)
return NULL;
Py_DECREF(res);
PyErr_Restore(type, value, traceback);
Py_XDECREF(res);
}
return NULL;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment