Skip to content

Commit aced381

Browse files
authored
gh-161767: Fix refleak in PyDict_AsFrozenDictAndClear() (#162250)
Py_DECREF() the frozendict if transfer_keys_and_values_lock_held() fails.
1 parent 9e181c4 commit aced381

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎Objects/dictobject.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8717,6 +8717,7 @@ PyDict_AsFrozenDictAndClear(PyObject *dict)
87178717
transfer = transfer_keys_and_values_lock_held(res, dict);
87188718
Py_END_CRITICAL_SECTION();
87198719
if (transfer < 0) {
8720+
Py_DECREF(res);
87208721
return NULL;
87218722
}
87228723

0 commit comments

Comments
 (0)