diff options
author | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-30 15:08:15 +0000 |
---|---|---|
committer | Hirokazu Yamamoto <ocean-city@m2.ccsnet.ne.jp> | 2010-10-30 15:08:15 +0000 |
commit | e0040b2197ac9d233f6c2a359c5968711bec7555 (patch) | |
tree | 808f4f99038cd5a44d1fcc0aeda3aab73991483f /Python/pythonrun.c | |
parent | 22f4419573acad7304d0d00b4b3b676e1e34c261 (diff) | |
download | cpython-e0040b2197ac9d233f6c2a359c5968711bec7555.tar.gz |
Issue #10157: Fixed refleaks in pythonrun.c. Patch by Stefan Krah.
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r-- | Python/pythonrun.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 33dd11bc88..8b1e61a1c9 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 */ |