Commits

Christian Heimes  committed 2b61128

Fixed possible reference leak to mod when type_name() returns NULL

  • Participants
  • Parent commits bb0390c
  • Branches 2.7

Comments (0)

Files changed (1)

File Objects/typeobject.c

         mod = NULL;
     }
     name = type_name(type, NULL);
-    if (name == NULL)
+    if (name == NULL) {
+        Py_XDECREF(mod);
         return NULL;
+    }
 
     if (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
         kind = "class";