Skip to content

Commit

Permalink
[3.11] Fix refleak in super_descr_get (GH-104440)
Browse files Browse the repository at this point in the history
(cherry picked from commit a781484)
  • Loading branch information
brandtbucher authored May 12, 2023
1 parent b90c922 commit 4ade7c3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ade7c3

Please sign in to comment.