Skip to content

Commit

Permalink
pythongh-118613: Fix error handling of _PyEval_GetFrameLocals in `c…
Browse files Browse the repository at this point in the history
…eval.c`
  • Loading branch information
sobolevn committed May 5, 2024
1 parent d8d9491 commit ab44c4a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Python/ceval.c
Original file line number Diff line number Diff line change
Expand Up @@ -2496,8 +2496,13 @@ _PyEval_GetFrameLocals(void)

if (PyFrameLocalsProxy_Check(locals)) {
PyObject* ret = PyDict_New();
if (ret == NULL) {
Py_DECREF(locals);
return NULL;
}
if (PyDict_Update(ret, locals)) {
Py_DECREF(ret);
Py_DECREF(locals);
return NULL;
}
Py_DECREF(locals);
Expand Down

0 comments on commit ab44c4a

Please sign in to comment.