Check return value of PyEval_GetGlobals() for NULL

CID 486814
This commit is contained in:
Christian Heimes 2013-07-20 22:54:25 +02:00
parent 09994a9c59
commit a6404ad43c
1 changed files with 7 additions and 2 deletions

View File

@ -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;