]> granicus.if.org Git - python/commitdiff
- Check for NULL result in PyType_FromSpec.
authorMartin v. Löwis <martin@v.loewis.de>
Mon, 21 Feb 2011 16:24:00 +0000 (16:24 +0000)
committerMartin v. Löwis <martin@v.loewis.de>
Mon, 21 Feb 2011 16:24:00 +0000 (16:24 +0000)
Misc/NEWS
Objects/typeobject.c

index 4c512466714e5b59d5b555f93e6300a8ba7db213..2b69b5b31505ee099e4dfd227b66190d296e5d2f 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -7,6 +7,11 @@ What's New in Python 3.3 Alpha 1?
 
 *Release date: XX-XXX-20XX*
 
+Core and Builtins
+-----------------
+
+- Check for NULL result in PyType_FromSpec.
+
 
 What's New in Python 3.2?
 =========================
index b1fe44ebe48ce748fc74d01059df24865a959030..7a1aa77e3f7e8f991551ac7fdddb453e157091ca 100644 (file)
@@ -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;