summaryrefslogtreecommitdiff
path: root/Python/compile.c
diff options
context:
space:
mode:
authorStefan Krah <skrah@bytereef.org>2015-07-27 12:56:49 +0200
committerStefan Krah <skrah@bytereef.org>2015-07-27 12:56:49 +0200
commitc2c079435efc01bdac0900d0100cf1403f5e5a1a (patch)
tree55f64ec004d650f8be720ced24f11a0668863503 /Python/compile.c
parentce95bfed1c80649f875206f85cd656fe80e8c005 (diff)
downloadcpython-c2c079435efc01bdac0900d0100cf1403f5e5a1a.tar.gz
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 027e3abe68..cfeab0fdfe 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) {