commit | 2fabface500d74457593b55ed06bc41ead88163e | [log] [tgz] |
---|---|---|
author | Antoine Pitrou <solipsis@pitrou.net> | Wed Jan 18 15:14:46 2012 +0100 |
committer | Antoine Pitrou <solipsis@pitrou.net> | Wed Jan 18 15:14:46 2012 +0100 |
tree | 0452b6cf9c194e78593505a7ebfe68bfc4cc2817 | |
parent | 892b0b928df40da72b0d88c5e1a2c879eff543c4 [diff] |
Fix a memory leak when initializing the standard I/O streams.
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4b0ac13..ec69bcb 100644 --- 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); }