summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-20 22:54:39 +0200
committerChristian Heimes <christian@cheimes.de>2013-07-20 22:54:39 +0200
commit2a442d066d721246b70f8cb55e05620017a003d7 (patch)
tree2a1f9af0df20c70f6d8958d6a09a0904df7b4e24 /Modules/pyexpat.c
parentd0c8029ce06c70eba01bf33b5346a5bae1d6d8b1 (diff)
parent1cb04c0bb123b34869633258a771156e9c6444ed (diff)
downloadcpython-2a442d066d721246b70f8cb55e05620017a003d7.tar.gz
Check return value of PyEval_GetGlobals() for NULL
CID 486814
Diffstat (limited to 'Modules/pyexpat.c')
-rw-r--r--Modules/pyexpat.c9
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;