summaryrefslogtreecommitdiffstats
path: root/Python/compile.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-07-27 10:57:21 (GMT)
committerStefan Krah <skrah@bytereef.org>2015-07-27 10:57:21 (GMT)
commitff9fe230d0d91306b9b3c805f89c738a00ebd90d (patch)
treece1dc71a15be46377f0942d10c72fa9c705ba7b0 /Python/compile.c
parent3e1770f5f3053604b7c10afbf9e35014409a419b (diff)
parentc0cbed15543cb48df70fec9680d58ae3454eaf4f (diff)
downloadcpython-ff9fe230d0d91306b9b3c805f89c738a00ebd90d.zip
cpython-ff9fe230d0d91306b9b3c805f89c738a00ebd90d.tar.gz
cpython-ff9fe230d0d91306b9b3c805f89c738a00ebd90d.tar.bz2
Fix refleak.
Diffstat (limited to 'Python/compile.c')
-rw-r--r--Python/compile.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Python/compile.c b/Python/compile.c
index 803c964..b246c3b 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) {