summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-30 15:08:15 (GMT)
committerHirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp>2010-10-30 15:08:15 (GMT)
commitdaf83acf003466777db394cb5e41d72ee6aea035 (patch)
tree5e220642753e8a742e5bcde4ec81f809d06abe7c
parent6ce29fa7a89cd266ca9dd3e21ed40f9100eb70f6 (diff)
downloadcpython-daf83acf003466777db394cb5e41d72ee6aea035.zip
cpython-daf83acf003466777db394cb5e41d72ee6aea035.tar.gz
cpython-daf83acf003466777db394cb5e41d72ee6aea035.tar.bz2
Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah.
-rw-r--r--Python/pythonrun.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c
index 33dd11b..8b1e61a 100644
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -283,6 +283,7 @@ Py_InitializeEx(int install_sigs)
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_NewInterpreter(void)
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 @@ initstdio(void)
if (encoding != NULL) {
_PyCodec_Lookup(encoding);
}
+ Py_DECREF(encoding_attr);
}
PyErr_Clear(); /* Not a fatal error if codec isn't available */