Skip to content

Commit 4ade7c3

Browse files
authored
[3.11] Fix refleak in super_descr_get (GH-104440)
(cherry picked from commit a781484)
1 parent b90c922 commit 4ade7c3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Objects/typeobject.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8969,8 +8969,10 @@ super_descr_get(PyObject *self, PyObject *obj, PyObject *type)
89698969
return NULL;
89708970
newobj = (superobject *)PySuper_Type.tp_new(&PySuper_Type,
89718971
NULL, NULL);
8972-
if (newobj == NULL)
8972+
if (newobj == NULL) {
8973+
Py_DECREF(obj_type);
89738974
return NULL;
8975+
}
89748976
Py_INCREF(su->type);
89758977
Py_INCREF(obj);
89768978
newobj->type = su->type;

0 commit comments

Comments
 (0)