mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
_PyUnicode_Fini(): Initialize the local freelist walking variable `u'
after unicode_empty has been freed, otherwise it might not point to the real start of the unicode_freelist. Final closure for SF bug #110681, Jitterbug PR#398.
This commit is contained in:
parent
562586eb3a
commit
5b4c22806f
1 changed files with 3 additions and 2 deletions
|
@ -5223,11 +5223,12 @@ void _PyUnicode_Init(void)
|
||||||
void
|
void
|
||||||
_PyUnicode_Fini(void)
|
_PyUnicode_Fini(void)
|
||||||
{
|
{
|
||||||
PyUnicodeObject *u = unicode_freelist;
|
PyUnicodeObject *u;
|
||||||
|
|
||||||
Py_XDECREF(unicode_empty);
|
Py_XDECREF(unicode_empty);
|
||||||
unicode_empty = NULL;
|
unicode_empty = NULL;
|
||||||
while (u != NULL) {
|
|
||||||
|
for (u = unicode_freelist; u != NULL;) {
|
||||||
PyUnicodeObject *v = u;
|
PyUnicodeObject *v = u;
|
||||||
u = *(PyUnicodeObject **)u;
|
u = *(PyUnicodeObject **)u;
|
||||||
if (v->str)
|
if (v->str)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue