mirror of
https://github.com/python/cpython.git
synced 2025-10-03 13:45:29 +00:00
Check return value of PyEval_GetGlobals() for NULL
CID 486814
This commit is contained in:
parent
09994a9c59
commit
a6404ad43c
1 changed files with 7 additions and 2 deletions
|
@ -283,12 +283,17 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args,
|
||||||
{
|
{
|
||||||
PyThreadState *tstate = PyThreadState_GET();
|
PyThreadState *tstate = PyThreadState_GET();
|
||||||
PyFrameObject *f;
|
PyFrameObject *f;
|
||||||
PyObject *res;
|
PyObject *res, *globals;
|
||||||
|
|
||||||
if (c == NULL)
|
if (c == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
f = PyFrame_New(tstate, c, PyEval_GetGlobals(), NULL);
|
globals = PyEval_GetGlobals();
|
||||||
|
if (globals == NULL) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
f = PyFrame_New(tstate, c, globals, NULL);
|
||||||
if (f == NULL)
|
if (f == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
tstate->frame = f;
|
tstate->frame = f;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue