mirror of https://github.com/python/cpython
Fix refleak in `super_descr_get` (#104408)
This commit is contained in:
parent
3c2992e58b
commit
a781484c8e
|
@ -10277,8 +10277,10 @@ super_descr_get(PyObject *self, PyObject *obj, PyObject *type)
|
||||||
return NULL;
|
return NULL;
|
||||||
newobj = (superobject *)PySuper_Type.tp_new(&PySuper_Type,
|
newobj = (superobject *)PySuper_Type.tp_new(&PySuper_Type,
|
||||||
NULL, NULL);
|
NULL, NULL);
|
||||||
if (newobj == NULL)
|
if (newobj == NULL) {
|
||||||
|
Py_DECREF(obj_type);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
newobj->type = (PyTypeObject*)Py_NewRef(su->type);
|
newobj->type = (PyTypeObject*)Py_NewRef(su->type);
|
||||||
newobj->obj = Py_NewRef(obj);
|
newobj->obj = Py_NewRef(obj);
|
||||||
newobj->obj_type = obj_type;
|
newobj->obj_type = obj_type;
|
||||||
|
|
Loading…
Reference in New Issue