diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f40e197f8c2..a1ad5021c41 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -10277,8 +10277,10 @@ super_descr_get(PyObject *self, PyObject *obj, PyObject *type) return NULL; newobj = (superobject *)PySuper_Type.tp_new(&PySuper_Type, NULL, NULL); - if (newobj == NULL) + if (newobj == NULL) { + Py_DECREF(obj_type); return NULL; + } newobj->type = (PyTypeObject*)Py_NewRef(su->type); newobj->obj = Py_NewRef(obj); newobj->obj_type = obj_type;