Commit a0e7e41c authored by Christian Heimes's avatar Christian Heimes

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

parent d5a88044
......@@ -647,8 +647,10 @@ type_repr(PyTypeObject *type)
mod = NULL;
}
name = type_name(type, NULL);
if (name == NULL)
if (name == NULL) {
Py_XDECREF(mod);
return NULL;
}
if (mod != NULL && PyUnicode_CompareWithASCIIString(mod, "builtins"))
rtn = PyUnicode_FromFormat("<class '%U.%U'>", mod, name);
......
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