From: Antoine Pitrou Date: Wed, 18 Jan 2012 14:14:46 +0000 (+0100) Subject: Fix a memory leak when initializing the standard I/O streams. X-Git-Tag: v3.2.3rc1~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fabface500d74457593b55ed06bc41ead88163e;p=thirdparty%2FPython%2Fcpython.git Fix a memory leak when initializing the standard I/O streams. --- diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 4b0ac139a2b0..ec69bcba8f45 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); }