Commit 4e80eea6 authored by Christian Heimes's avatar Christian Heimes

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

parent 074ebced
......@@ -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";
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment