[Python-checkins] cpython (3.5): Fix refleak.

stefan.krah python-checkins at python.org
Mon Jul 27 13:08:50 CEST 2015


https://hg.python.org/cpython/rev/07d37b87d1c0
changeset: 97083:07d37b87d1c0
branch: 3.5
parent: 97081:cb0c56f87a47
user: Stefan Krah <skrah at bytereef.org>
date: Mon Jul 27 12:56:49 2015 +0200
summary:
 Fix refleak.
files:
 Python/compile.c | 4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/Python/compile.c b/Python/compile.c
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1146,8 +1146,10 @@
 
 v = PyDict_GetItem(dict, t);
 if (!v) {
- if (PyErr_Occurred())
+ if (PyErr_Occurred()) {
+ Py_DECREF(t);
 return -1;
+ }
 arg = PyDict_Size(dict);
 v = PyLong_FromSsize_t(arg);
 if (!v) {
-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /