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

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


http://hg.python.org/cpython/rev/a321ffb21367
changeset:   74497:a321ffb21367
parent:      74495:b86b54fcb5c2
parent:      74496:93e86b9318f7
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Wed Jan 18 15:28:38 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
@@ -1032,7 +1032,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