Skip to content

Commit 5b65df7

Browse files
[3.14] gh-109700: fix memory error handling in PyDict_SetDefault (GH-136338) (#136340)
gh-109700: fix memory error handling in `PyDict_SetDefault` (GH-136338) (cherry picked from commit d22e073) Co-authored-by: Kumar Aditya <[email protected]>
1 parent 3ea7276 commit 5b65df7

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
@@ -4411,6 +4411,7 @@ dict_setdefault_ref_lock_held(PyObject *d, PyObject *key, PyObject *default_valu
44114411
if (result) {
44124412
*result = NULL;
44134413
}
4414+
return -1;
44144415
}
44154416

44164417
STORE_USED(mp, mp->ma_used + 1);

0 commit comments

Comments
 (0)