summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-07-27 10:56:49 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-07-27 10:56:49 (GMT)
commitc0cbed15543cb48df70fec9680d58ae3454eaf4f (patch)
treeff6dbaebe1726dd2f12c77588675ee7fc53e2b75 /Python
parentf66f4208b79974b348b76b90c0117b26e4dbfd21 (diff)
downloadcpython-c0cbed15543cb48df70fec9680d58ae3454eaf4f.zip
cpython-c0cbed15543cb48df70fec9680d58ae3454eaf4f.tar.gz
cpython-c0cbed15543cb48df70fec9680d58ae3454eaf4f.tar.bz2
Fix refleak.
Diffstat (limited to 'Python')
-rw-r--r--Python/compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 027e3ab..cfeab0f 100644
--- a/Python/compile.c
+++ b/Python/compile.c
@@ -1146,8 +1146,10 @@ compiler_add_o(struct compiler *c, PyObject *dict, PyObject *o)
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) {