diff options
-rw-r--r-- | Modules/pyexpat.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index 87cec92..156dbf1 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -286,12 +286,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; |