[Python-checkins] cpython (3.2): Fix a memory leak when initializing the standard I/O streams.

antoine.pitrou python-checkins at python.org
Wed Jan 18 15:30:32 CET 2012


http://hg.python.org/cpython/rev/93e86b9318f7
changeset: 74496:93e86b9318f7
branch: 3.2
parent: 74493:7d405058e458
user: Antoine Pitrou <solipsis at pitrou.net>
date: Wed Jan 18 15:14:46 2012 +0100
summary:
 Fix a memory leak when initializing the standard I/O streams.
files:
 Python/pythonrun.c | 3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1012,7 +1012,8 @@
 const char * encoding;
 encoding = _PyUnicode_AsString(encoding_attr);
 if (encoding != NULL) {
- _PyCodec_Lookup(encoding);
+ PyObject *codec_info = _PyCodec_Lookup(encoding);
+ Py_XDECREF(codec_info);
 }
 Py_DECREF(encoding_attr);
 }
-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list

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