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:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user