]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-90699: Clear interned strings in `_elementtree` (#101185)
authorErlend E. Aasland <erlend.aasland@protonmail.com>
Fri, 20 Jan 2023 11:04:14 +0000 (12:04 +0100)
committerGitHub <noreply@github.com>
Fri, 20 Jan 2023 11:04:14 +0000 (16:34 +0530)
Modules/_elementtree.c

index 555c22f88b36d511e126d23810532a07b2c0aa72..e0ab79103f06f7bbba283415c7890f037d1b4f05 100644 (file)
@@ -122,6 +122,16 @@ elementtree_clear(PyObject *m)
     Py_CLEAR(st->elementpath_obj);
     Py_CLEAR(st->comment_factory);
     Py_CLEAR(st->pi_factory);
+
+    // Interned strings
+    Py_CLEAR(st->str_append);
+    Py_CLEAR(st->str_find);
+    Py_CLEAR(st->str_findall);
+    Py_CLEAR(st->str_findtext);
+    Py_CLEAR(st->str_iterfind);
+    Py_CLEAR(st->str_tail);
+    Py_CLEAR(st->str_text);
+    Py_CLEAR(st->str_doctype);
     return 0;
 }