diff options
author | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:54:39 +0200 |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-07-20 22:54:39 +0200 |
commit | 2a442d066d721246b70f8cb55e05620017a003d7 (patch) | |
tree | 2a1f9af0df20c70f6d8958d6a09a0904df7b4e24 /Modules/pyexpat.c | |
parent | d0c8029ce06c70eba01bf33b5346a5bae1d6d8b1 (diff) | |
parent | 1cb04c0bb123b34869633258a771156e9c6444ed (diff) | |
download | cpython-2a442d066d721246b70f8cb55e05620017a003d7.tar.gz |
Check return value of PyEval_GetGlobals() for NULL
CID 486814
Diffstat (limited to 'Modules/pyexpat.c')
-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 87cec92041..156dbf13ba 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; |