-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
Closed
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Bug report
We need to handle the case where allocate_weakref returns NULL due to an out-of-memory error.
cpython/Objects/weakrefobject.c
Lines 428 to 439 in dc03ce7
| PyWeakReference *newref = allocate_weakref(type, obj, callback); | |
| insert_weakref(newref, list); | |
| UNLOCK_WEAKREFS(obj); | |
| return newref; | |
| } | |
| else { | |
| // We may not be able to safely allocate inside the lock | |
| PyWeakReference *newref = allocate_weakref(type, obj, callback); | |
| LOCK_WEAKREFS(obj); | |
| insert_weakref(newref, list); | |
| UNLOCK_WEAKREFS(obj); | |
| return newref; |
Linked PRs
Metadata
Metadata
Assignees
Labels
3.13bugs and security fixesbugs and security fixes3.14bugs and security fixesbugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error