Bug report
Here's the problematic code:
|
if (PyFrameLocalsProxy_Check(locals)) { |
|
PyObject* ret = PyDict_New(); |
|
if (PyDict_Update(ret, locals)) { |
|
Py_DECREF(ret); |
|
return NULL; |
|
} |
|
Py_DECREF(locals); |
|
return ret; |
What's wrong?
PyDict_New() can return NULL, it is not checked
Py_DECREF(locals); is only called on success, but not on error
Refs b034f14
I have a PR ready.
Linked PRs
Bug report
Here's the problematic code:
cpython/Python/ceval.c
Lines 2497 to 2504 in d8d9491
What's wrong?
PyDict_New()can returnNULL, it is not checkedPy_DECREF(locals);is only called on success, but not on errorRefs b034f14
I have a PR ready.
Linked PRs
_PyEval_GetFrameLocalsinceval.c#118614