diff --git a/Objects/typeobject.c b/Objects/typeobject.c index f1745c91967358..9b51451ac47b7f 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -10267,8 +10267,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;