summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Objects/typeobject.c5
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);