mirror of
https://github.com/python/cpython.git
synced 2025-09-19 23:20:25 +00:00
Fixed possible reference leak to mod when type_name() returns NULL
This commit is contained in:
parent
074ebced1b
commit
4e80eea60e
1 changed files with 3 additions and 1 deletions
|
@ -686,8 +686,10 @@ type_repr(PyTypeObject *type)
|
||||||
mod = NULL;
|
mod = NULL;
|
||||||
}
|
}
|
||||||
name = type_name(type, NULL);
|
name = type_name(type, NULL);
|
||||||
if (name == NULL)
|
if (name == NULL) {
|
||||||
|
Py_XDECREF(mod);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
|
if (type->tp_flags & Py_TPFLAGS_HEAPTYPE)
|
||||||
kind = "class";
|
kind = "class";
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue