diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 20:54:39 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 20:54:39 (GMT) |
commit | 603bd2d374535950720c69efaff04c26c059257e (patch) | |
tree | 0c47cb6409156ba243295796fbf5de1a2bbcbf4f /Modules | |
parent | 5df8ff01d914d1757990438ca6c518d0b1497e96 (diff) | |
parent | a6404ad43c11d04909a9e01f85559e1b52e616b4 (diff) | |
download | cpython-603bd2d374535950720c69efaff04c26c059257e.zip cpython-603bd2d374535950720c69efaff04c26c059257e.tar.gz cpython-603bd2d374535950720c69efaff04c26c059257e.tar.bz2 |
Check return value of PyEval_GetGlobals() for NULL
CID 486814
Diffstat (limited to 'Modules')
-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; |