Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b4c228

Browse files
committed
_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.
1 parent 562586e commit 5b4c228

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

Objects/unicodeobject.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5223,11 +5223,12 @@ void _PyUnicode_Init(void)
52235223
void
52245224
_PyUnicode_Fini(void)
52255225
{
5226-
PyUnicodeObject *u = unicode_freelist;
5226+
PyUnicodeObject *u;
52275227

52285228
Py_XDECREF(unicode_empty);
52295229
unicode_empty = NULL;
5230-
while (u != NULL) {
5230+
5231+
for (u = unicode_freelist; u != NULL;) {
52315232
PyUnicodeObject *v = u;
52325233
u = *(PyUnicodeObject **)u;
52335234
if (v->str)

0 commit comments

Comments
 (0)