Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[3.11] Fix refleak in super_descr_get (GH-104408).
(cherry picked from commit a781484)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
  • Loading branch information
brandtbucher committed May 12, 2023
commit 7a1baf20fbc369a9d66f56d132c785482d48fbe1
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