From: Victor Stinner Date: Sat, 20 Aug 2016 00:37:41 +0000 (+0200) Subject: Issue #27366: Fix init_subclass() X-Git-Tag: v3.6.0b1~635 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=253021dd945b824097415d76b5925a82b9b3e0bc;p=thirdparty%2FPython%2Fcpython.git Issue #27366: Fix init_subclass() Handle PyTuple_New(0) failure. --- diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 68e4f90ab6bc..0f1835585327 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -7018,6 +7018,11 @@ init_subclass(PyTypeObject *type, PyObject *kwds) return -1; tuple = PyTuple_New(0); + if (tuple == NULL) { + Py_DECREF(func); + return 0; + } + tmp = PyObject_Call(func, tuple, kwds); Py_DECREF(tuple); Py_DECREF(func);