1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

tests: Fix use-after-free in Python tests

The nodeset must be freed before the document.

Fixes #443.
This commit is contained in:
Nick Wellnhofer
2022-11-22 17:01:39 +01:00
parent 550345057d
commit 97c0a9cff7

View File

@@ -11,6 +11,7 @@ d = libxml2.parseDoc("<a:a xmlns:a='urn:whatevar'/>")
res=""
for n in d.xpathEval("//namespace::*"):
res = res + n.serialize()
del n
d.freeDoc()
if res != expect:
@@ -18,7 +19,6 @@ if res != expect:
print(res)
del res
del d
del n
# Memory debug specific
libxml2.cleanupParser()