Browse Source

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

pull/2332/head
Christian Heimes 14 years ago
parent
commit
4e80eea60e
  1. 4
      Objects/typeobject.c

4
Objects/typeobject.c

@ -686,8 +686,10 @@ type_repr(PyTypeObject *type)
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";

Loading…
Cancel
Save