Mercurial > cpython-lru_cache-weakref
diff Python/pythonrun.c @ 74497:a321ffb21367
Fix a memory leak when initializing the standard I/O streams.
| author | Antoine Pitrou <solipsis@pitrou.net> |
|---|---|
| date | Wed, 18 Jan 2012 15:28:38 +0100 |
| parents | 87331661042b 93e86b9318f7 |
| children | 2bd7f40108b4 |
line wrap: on
line diff
--- a/Python/pythonrun.c Wed Jan 18 14:01:17 2012 +0100 +++ b/Python/pythonrun.c Wed Jan 18 15:28:38 2012 +0100 @@ -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); }
