Skip to content

Commit 3243ba1

Browse files
kumaraditya303AndPuQing
authored andcommitted
pythongh-109700: fix memory error handling in PyDict_SetDefault (python#136338)
1 parent 47ce0d8 commit 3243ba1

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)