summaryrefslogtreecommitdiff
path: root/Modules/pyexpat.c
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-20 22:54:25 +0200
committerChristian Heimes <christian@cheimes.de>2013-07-20 22:54:25 +0200
commita6404ad43c11d04909a9e01f85559e1b52e616b4 (patch)
tree68dbe8091038760ebbb1f99f882ec2e6d9430c6c /Modules/pyexpat.c
parent09994a9c595b35e0ee99e69172abf8b8a1ff7994 (diff)
downloadcpython-git-a6404ad43c11d04909a9e01f85559e1b52e616b4.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 07b1348d37..7e51d35e62 100644
--- a/Modules/pyexpat.c
+++ b/Modules/pyexpat.c
@@ -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;