Skip to content

Commit

Permalink
Fix refleak in super_descr_get (python#104408)
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher committed May 12, 2023
1 parent 3c2992e commit a781484
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 @@ -10277,8 +10277,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;
}
newobj->type = (PyTypeObject*)Py_NewRef(su->type);
newobj->obj = Py_NewRef(obj);
newobj->obj_type = obj_type;
Expand Down

0 comments on commit a781484

Please sign in to comment.