mirror of https://github.com/python/cpython
Check return value of PyEval_GetGlobals() for NULL
CID 486814
This commit is contained in:
parent
09994a9c59
commit
a6404ad43c
|
@ -283,12 +283,17 @@ call_with_frame(PyCodeObject *c, PyObject* func, PyObject* args,
|
|||
{
|
||||
PyThreadState *tstate = PyThreadState_GET();
|
||||
PyFrameObject *f;
|
||||
PyObject *res;
|
||||
PyObject *res, *globals;
|
||||
|
||||
if (c == 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)
|
||||
return NULL;
|
||||
tstate->frame = f;
|
||||
|
|
Loading…
Reference in New Issue