summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Misc/NEWS11
-rw-r--r--Objects/typeobject.c2
2 files changed, 13 insertions, 0 deletions
diff --git a/Misc/NEWS b/Misc/NEWS
index c34a540820..dbbf2d2f2b 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,6 +2,17 @@
Python News
+++++++++++
+What's New in Python 3.2.1?
+===========================
+
+*Release date: XX-XXX-20XX*
+
+Core and Builtins
+-----------------
+
+- Check for NULL result in PyType_FromSpec.
+
+
What's New in Python 3.2?
=========================
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b1fe44ebe4..7a1aa77e3f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -2330,6 +2330,8 @@ PyObject* PyType_FromSpec(PyType_Spec *spec)
char *res_start = (char*)res;
PyType_Slot *slot;
+ if (res == NULL)
+ return NULL;
res->ht_name = PyUnicode_FromString(spec->name);
if (!res->ht_name)
goto fail;