Skip to content

Commit 823bf76

Browse files
[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 d22e073)
1 parent ce21b1a commit 823bf76

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix memory error handling in :c:func:`PyDict_SetDefault`.

Objects/dictobject.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4340,6 +4340,7 @@ dict_setdefault_ref_lock_held(PyObject *d, PyObject *key, PyObject *default_valu
43404340
if (result) {
43414341
*result = NULL;
43424342
}
4343+
return -1;
43434344
}
43444345

43454346
MAINTAIN_TRACKING(mp, key, value);

0 commit comments

Comments
 (0)