summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorAntoine Pitrou <solipsis@pitrou.net>2012-01-18 14:28:38 (GMT)
committerAntoine Pitrou <solipsis@pitrou.net>2012-01-18 14:28:38 (GMT)
commitfff47ab342e79d02cf871980987b8b30b2f09c37 (patch)
treee5861b42315d672b41a9ea0127b0ee9b109321c9 /Python
parentc5e1199f3865a2671e3ce16c6265aa869466356b (diff)
parent2fabface500d74457593b55ed06bc41ead88163e (diff)
downloadcpython-fff47ab342e79d02cf871980987b8b30b2f09c37.zip
cpython-fff47ab342e79d02cf871980987b8b30b2f09c37.tar.gz
cpython-fff47ab342e79d02cf871980987b8b30b2f09c37.tar.bz2
Fix a memory leak when initializing the standard I/O streams.
Diffstat (limited to 'Python')
-rw-r--r--Python/pythonrun.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 761110a..bff04de 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);
}