mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
This commit is contained in:
commit
2e1c4e5db2
1 changed files with 2 additions and 6 deletions
|
|
@ -2441,14 +2441,10 @@ fail:
|
||||||
if (saved_state) {
|
if (saved_state) {
|
||||||
PyObject *type, *value, *traceback;
|
PyObject *type, *value, *traceback;
|
||||||
PyErr_Fetch(&type, &value, &traceback);
|
PyErr_Fetch(&type, &value, &traceback);
|
||||||
|
|
||||||
res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state);
|
res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state);
|
||||||
|
_PyErr_ChainExceptions(type, value, traceback);
|
||||||
Py_DECREF(saved_state);
|
Py_DECREF(saved_state);
|
||||||
if (res == NULL)
|
Py_XDECREF(res);
|
||||||
return NULL;
|
|
||||||
Py_DECREF(res);
|
|
||||||
|
|
||||||
PyErr_Restore(type, value, traceback);
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue