diff options
-rw-r--r-- | Objects/typeobject.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c index a351667..5565b20 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4329,6 +4329,8 @@ add_subclass(PyTypeObject *base, PyTypeObject *type) } assert(PyList_Check(list)); newobj = PyWeakref_NewRef((PyObject *)type, NULL); + if (newobj == NULL) + return -1; i = PyList_GET_SIZE(list); while (--i >= 0) { ref = PyList_GET_ITEM(list, i); |