summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-04-11 17:16:24 (GMT)
committerGeorg Brandl <georg@python.org>2007-04-11 17:16:24 (GMT)
commitc02e13122ba94b05dc03fd56de393b9129f3ed25 (patch)
tree1928b2cb6377a200b57505ce08d6e0ff3135985f /Objects/exceptions.c
parent5bf02cd17f96217cbdffd84e3b00bf5c97acf69e (diff)
downloadcpython-c02e13122ba94b05dc03fd56de393b9129f3ed25.zip
cpython-c02e13122ba94b05dc03fd56de393b9129f3ed25.tar.gz
cpython-c02e13122ba94b05dc03fd56de393b9129f3ed25.tar.bz2
Add some missing NULL checks which trigger crashes on low-memory conditions.
Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
Diffstat (limited to 'Objects/exceptions.c')
-rw-r--r--Objects/exceptions.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Objects/exceptions.c b/Objects/exceptions.c
index c6ea6a4..65419de 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -33,6 +33,8 @@ BaseException_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
PyBaseExceptionObject *self;
self = (PyBaseExceptionObject *)type->tp_alloc(type, 0);
+ if (!self)
+ return NULL;
/* the dict is created on the fly in PyObject_GenericSetAttr */
self->message = self->dict = NULL;