summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
diff options
context:
space:
mode:
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 6832fd9..2b05cc5 100644
--- a/Objects/exceptions.c
+++ b/Objects/exceptions.c
@@ -24,6 +24,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;