[3.13] gh-109700: fix memory error handling in PyDict_SetDefault (#136338) (#136642)

gh-109700: fix memory error handling in `PyDict_SetDefault` (#136338)

(cherry picked from commit d22e073d2b)
This commit is contained in:
Kumar Aditya 2025-07-14 13:55:31 +05:30 committed by GitHub
parent ce21b1a250
commit 823bf76d37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View file

@ -0,0 +1 @@
Fix memory error handling in :c:func:`PyDict_SetDefault`.

View file

@ -4340,6 +4340,7 @@ dict_setdefault_ref_lock_held(PyObject *d, PyObject *key, PyObject *default_valu
if (result) {
*result = NULL;
}
return -1;
}
MAINTAIN_TRACKING(mp, key, value);