summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-18 15:28:38 +0100
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-18 15:28:38 +0100
commitdd772fbea93c53c549782a567b58201cb71566c9 (patch)
treed9486d53fec268cd48b3d74febe9e09e8e09dd1c /Python/pythonrun.c
parentde78d87855efe88cd927e07a113bf5ac13c41489 (diff)
parentd7a1b71b34af52ecbc6f22544f0bc4eb1e7198f7 (diff)
downloadcpython-dd772fbea93c53c549782a567b58201cb71566c9.tar.gz
Fix a memory leak when initializing the standard I/O streams.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 761110a86c..bff04de599 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -1032,7 +1032,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);
}