summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2022-10-22 16:48:58 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2022-10-23 14:27:05 +0200
commitea7c9fb5dd4c0008ecbe897bc9072ba2373e5537 (patch)
tree7a7542e293edf8fda4ccb6e0dd9f3c0f24897e4c
parentc99cde3f2150be596b2df8a288aa20a4416af71c (diff)
downloadlibxml2-ea7c9fb5dd4c0008ecbe897bc9072ba2373e5537.tar.gz
xinclude: Don't create result doc for test with errors
-rw-r--r--result/XInclude/nodes3.xml5
-rw-r--r--runtest.c5
2 files changed, 4 insertions, 6 deletions
diff --git a/result/XInclude/nodes3.xml b/result/XInclude/nodes3.xml
deleted file mode 100644
index 9ab20448..00000000
--- a/result/XInclude/nodes3.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0"?>
-<x xmlns:xinclude="http://www.w3.org/2003/XInclude">
- <!-- Simple test of including a set of nodes from an XML document -->
- <xinclude:include href="../ents/something.xml#xpointer(//p)"/>
-</x>
diff --git a/runtest.c b/runtest.c
index d256ea31..4c1c2677 100644
--- a/runtest.c
+++ b/runtest.c
@@ -2102,7 +2102,10 @@ errParseTest(const char *filename, const char *result, const char *err,
#ifdef LIBXML_XINCLUDE_ENABLED
if (options & XML_PARSE_XINCLUDE) {
doc = xmlReadFile(filename, NULL, options);
- xmlXIncludeProcessFlags(doc, options);
+ if (xmlXIncludeProcessFlags(doc, options) < 0) {
+ xmlFreeDoc(doc);
+ doc = NULL;
+ }
} else
#endif
{