diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 14:28:38 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2012-01-18 14:28:38 (GMT) |
commit | fff47ab342e79d02cf871980987b8b30b2f09c37 (patch) | |
tree | e5861b42315d672b41a9ea0127b0ee9b109321c9 /Python | |
parent | c5e1199f3865a2671e3ce16c6265aa869466356b (diff) | |
parent | 2fabface500d74457593b55ed06bc41ead88163e (diff) | |
download | cpython-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.c | 3 |
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); } |