diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2016-08-20 00:37:41 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2016-08-20 00:37:41 (GMT) |
commit | 253021dd945b824097415d76b5925a82b9b3e0bc (patch) | |
tree | f85ddd7fcf52755e24195efe64eb606e58784b0f | |
parent | ea5e5990c9a26b81b149417239e0fe435a621818 (diff) | |
download | cpython-253021dd945b824097415d76b5925a82b9b3e0bc.zip cpython-253021dd945b824097415d76b5925a82b9b3e0bc.tar.gz cpython-253021dd945b824097415d76b5925a82b9b3e0bc.tar.bz2 |
Issue #27366: Fix init_subclass()
Handle PyTuple_New(0) failure.
-rw-r--r-- | Objects/typeobject.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 68e4f90..0f18355 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); |