diff options
author | Barry Warsaw <barry@python.org> | 2000-10-03 20:45:26 (GMT) |
---|---|---|
committer | Barry Warsaw <barry@python.org> | 2000-10-03 20:45:26 (GMT) |
commit | 5b4c22806fe6bdd7cb2d6c01e0a09e10c90be0bc (patch) | |
tree | 403f956361bd2fa25cc159cec9659e6730b036a7 /Objects | |
parent | 562586eb3abdc890ff8f811e3ffb4e369181200c (diff) | |
download | cpython-5b4c22806fe6bdd7cb2d6c01e0a09e10c90be0bc.zip cpython-5b4c22806fe6bdd7cb2d6c01e0a09e10c90be0bc.tar.gz cpython-5b4c22806fe6bdd7cb2d6c01e0a09e10c90be0bc.tar.bz2 |
_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.
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/unicodeobject.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 8d04b2d..b31675b 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5223,11 +5223,12 @@ void _PyUnicode_Init(void) void _PyUnicode_Fini(void) { - PyUnicodeObject *u = unicode_freelist; + PyUnicodeObject *u; Py_XDECREF(unicode_empty); unicode_empty = NULL; - while (u != NULL) { + + for (u = unicode_freelist; u != NULL;) { PyUnicodeObject *v = u; u = *(PyUnicodeObject **)u; if (v->str) |