From: Benjamin Peterson Date: Sat, 2 Jun 2012 06:57:36 +0000 (-0700) Subject: don't leak if the __class__ closure is set X-Git-Tag: v3.3.0b1~308^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8e8fbeae27e3fbfa80ad59fd2aeb563116e6a4c4;p=thirdparty%2FPython%2Fcpython.git don't leak if the __class__ closure is set --- diff --git a/Python/bltinmodule.c b/Python/bltinmodule.c index e2ff0ba1c530..232e3dc49709 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);