Skip to content
Prev Previous commit
Next Next commit
Decref materialized dict on fail to set
  • Loading branch information
DinoV committed Apr 19, 2024
commit 8433d25fa63f396dc40aa5cb7c0d235d31155b8e
1 change: 1 addition & 0 deletions Objects/dictobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6734,6 +6734,7 @@ store_instance_attr_lock_held(PyObject *obj, PyDictValues *values,
dict = make_dict_from_instance_attributes(PyInterpreterState_Get(), keys, values);
if (dict == NULL ||
set_or_del_lock_held(dict, name, value) < 0) {
Py_XDECREF(dict);
return -1;
}

Expand Down