[Python-checkins] r85980 - python/branches/py3k/Python/pythonrun.c
hirokazu.yamamoto
python-checkins at python.org
Sat Oct 30 17:08:15 CEST 2010
Author: hirokazu.yamamoto
Date: Sat Oct 30 17:08:15 2010
New Revision: 85980
Log:
Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah.
Modified:
python/branches/py3k/Python/pythonrun.c
Modified: python/branches/py3k/Python/pythonrun.c
==============================================================================
--- python/branches/py3k/Python/pythonrun.c (original)
+++ python/branches/py3k/Python/pythonrun.c Sat Oct 30 17:08:15 2010
@@ -283,6 +283,7 @@
Py_FatalError("Py_Initialize: can't set preliminary stderr");
PySys_SetObject("stderr", pstderr);
PySys_SetObject("__stderr__", pstderr);
+ Py_DECREF(pstderr);
_PyImport_Init();
@@ -605,6 +606,7 @@
Py_FatalError("Py_Initialize: can't set preliminary stderr");
PySys_SetObject("stderr", pstderr);
PySys_SetObject("__stderr__", pstderr);
+ Py_DECREF(pstderr);
_PyImportHooks_Init();
if (initstdio() < 0)
@@ -971,6 +973,7 @@
if (encoding != NULL) {
_PyCodec_Lookup(encoding);
}
+ Py_DECREF(encoding_attr);
}
PyErr_Clear(); /* Not a fatal error if codec isn't available */
More information about the Python-checkins
mailing list