8000 gh-118613: Fix error handling of `_PyEval_GetFrameLocals` in `ceval.c` · sobolevn/cpython@ab44c4a · GitHub
[go: up one dir, main page]

Skip to content

Commit ab44c4a

Browse files
committed
pythongh-118613: Fix error handling of _PyEval_GetFrameLocals in ceval.c
1 parent d8d9491 commit ab44c4a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Python/ceval.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,8 +2496,13 @@ _PyEval_GetFrameLocals(void)
24962496

24972497
if (PyFrameLocalsProxy_Check(locals)) {
24982498
PyObject* ret = PyDict_New();
2499+
if (ret == NULL) {
2500+
Py_DECREF(locals);
2501+
return NULL;
2502+
}
24992503
if (PyDict_Update(ret, locals)) {
25002504
Py_DECREF(ret);
2505+
Py_DECREF(locals);
25012506
return NULL;
25022507
}
25032508
Py_DECREF(locals);

0 commit comments

Comments
 (0)
0