[Python-checkins] cpython (merge 3.4 -> default): Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.

serhiy.storchaka python-checkins at python.org
Mon Mar 30 09:01:48 CEST 2015


https://hg.python.org/cpython/rev/2fcd99929dba
changeset: 95283:2fcd99929dba
parent: 95280:6a4b83c56b86
parent: 95282:442ebebad516
user: Serhiy Storchaka <storchaka at gmail.com>
date: Mon Mar 30 10:00:40 2015 +0300
summary:
 Issue #23785: Fixed memory leak in TextIOWrapper.tell() in rare circumstances.
files:
 Modules/_io/textio.c | 8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/Modules/_io/textio.c b/Modules/_io/textio.c
--- a/Modules/_io/textio.c
+++ b/Modules/_io/textio.c
@@ -2441,14 +2441,10 @@
 if (saved_state) {
 PyObject *type, *value, *traceback;
 PyErr_Fetch(&type, &value, &traceback);
-
 res = _PyObject_CallMethodId(self->decoder, &PyId_setstate, "(O)", saved_state);
+ _PyErr_ChainExceptions(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;
 }
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /