Skip to content
Prev Previous commit
Fix missing decref when storing and dict is detached but has been del…
…eted
  • Loading branch information
DinoV committed Apr 19, 2024
commit ac503e8ae657f127fd06abe8e17f8c96815f8fce
3 changes: 3 additions & 0 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6805,6 +6805,9 @@ _PyObject_StoreInstanceAttribute(PyObject *obj, PyObject *name, PyObject *value)
if (dict == NULL) {
return -1;
}
int res = store_instance_attr_dict(obj, dict, name, value);
Py_DECREF(dict);
return res;
}
return store_instance_attr_dict(obj, dict, name, value);
}
Expand Down