mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
[3.11] Fix refleak in super_descr_get (GH-104440)
(cherry picked from commit a781484c8e)
This commit is contained in:
parent
b90c922f3f
commit
4ade7c3369
1 changed files with 3 additions and 1 deletions
|
|
@ -8969,8 +8969,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;
|
||||
}
|
||||
Py_INCREF(su->type);
|
||||
Py_INCREF(obj);
|
||||
newobj->type = su->type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue