From e487005ebd89b3c206ec8086c943f3f62e799d3e Mon Sep 17 00:00:00 2001 From: "Erlend E. Aasland" Date: Fri, 20 Jan 2023 10:16:10 +0100 Subject: [PATCH] GH-90699: Clear interned strings in _elementtree Interned strings were added in GH-99012 --- Modules/_elementtree.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Modules/_elementtree.c b/Modules/_elementtree.c index 555c22f88b36d5..e0ab79103f06f7 100644 --- a/Modules/_elementtree.c +++ b/Modules/_elementtree.c @@ -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; }