diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 15:14:46 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 15:14:46 +0100 |
commit | d7a1b71b34af52ecbc6f22544f0bc4eb1e7198f7 (patch) | |
tree | a95b1b8cd60649abea12319b53c5305b5a7af73d /Python/pythonrun.c | |
parent | 863f02a6442a270877e94eb8980c80692b779ed1 (diff) | |
download | cpython-d7a1b71b34af52ecbc6f22544f0bc4eb1e7198f7.tar.gz |
Fix a memory leak when initializing the standard I/O streams.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4b0ac139a2..ec69bcba8f 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c @@ -1012,7 +1012,8 @@ initstdio(void) 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); } |