summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-06-02 06:57:36 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-06-02 06:57:36 (GMT)
commit8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4 (patch)
treeb09f29ebfc88d2870efaa2339732561930956d4d
parentae1b94b6e4091f9b8c9249ad535a2f121030dd2e (diff)
downloadcpython-8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4.zip
cpython-8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4.tar.gz
cpython-8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4.tar.bz2
don't leak if the __class__ closure is set
-rw-r--r--Python/bltinmodule.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c
index e2ff0ba..232e3dc 100644
--- a/Python/bltinmodule.c
+++ b/Python/bltinmodule.c
@@ -158,10 +158,8 @@ builtin___build_class__(PyObject *self, PyObject *args, PyObject *kwds)
cls = PyEval_CallObjectWithKeywords(meta, margs, mkw);
Py_DECREF(margs);
}
- if (cls != NULL && PyCell_Check(cell)) {
- Py_INCREF(cls);
- PyCell_SET(cell, cls);
- }
+ if (cls != NULL && PyCell_Check(cell))
+ PyCell_Set(cell, cls);
Py_DECREF(cell);
}
Py_DECREF(ns);