]> granicus.if.org Git - python/commitdiff
_PyUnicode_Fini(): Initialize the local freelist walking variable `u'
authorBarry Warsaw <barry@python.org>
Tue, 3 Oct 2000 20:45:26 +0000 (20:45 +0000)
committerBarry Warsaw <barry@python.org>
Tue, 3 Oct 2000 20:45:26 +0000 (20:45 +0000)
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.

Objects/unicodeobject.c

index 8d04b2d0bb30f0475cca765cb083a82c6aab782e..b31675b496889bb11ff1a32493094f1a3b42ba3b 100644 (file)
@@ -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)