Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 74496:93e86b9318f7 3.2
Fix a memory leak when initializing the standard I/O streams.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 18 Jan 2012 15:14:46 +0100 |
| parents | f15943505db0 |
| children | 4a31f6b11e7a a321ffb21367 |
line wrap: on
line diff
--- a/Python/pythonrun.c Wed Jan 18 09:25:58 2012 +0200 +++ b/Python/pythonrun.c Wed Jan 18 15:14:46 2012 +0100 @@ -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); }
