GH-90699: Clear interned strings in `_elementtree` (#101185)

This commit is contained in:
Erlend E. Aasland 2023-01-20 12:04:14 +01:00 committed by GitHub
parent 8cdbc46090
commit 9109d46051
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View 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;
}