mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
fix possible refleaks
This commit is contained in:
parent
89f8b80202
commit
0fa35ea8f3
1 changed files with 4 additions and 2 deletions
|
@ -540,13 +540,15 @@ new_identifier(const char* n, PyArena *arena)
|
|||
if (PyUnicode_IS_ASCII(id)) {
|
||||
PyObject *m = PyImport_ImportModuleNoBlock("unicodedata");
|
||||
PyObject *id2;
|
||||
if (!m)
|
||||
if (!m) {
|
||||
Py_DECREF(id);
|
||||
return NULL;
|
||||
}
|
||||
id2 = _PyObject_CallMethodId(m, &PyId_normalize, "sO", "NFKC", id);
|
||||
Py_DECREF(m);
|
||||
Py_DECREF(id);
|
||||
if (!id2)
|
||||
return NULL;
|
||||
Py_DECREF(id);
|
||||
id = id2;
|
||||
}
|
||||
PyUnicode_InternInPlace(&id);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue