Skip to content
Snippets Groups Projects
Commit 075286e51f9a authored by Nick Wellnhofer's avatar Nick Wellnhofer
Browse files

tests: Fix memory leak in runtest.c

parent ce6e78807f21
No related branches found
No related tags found
No related merge requests found
...@@ -582,7 +582,7 @@ ...@@ -582,7 +582,7 @@
static int static int
xsltTest(const char *filename, int options) { xsltTest(const char *filename, int options) {
xsltStylesheetPtr style; xsltStylesheetPtr style;
xmlDocPtr styleDoc, doc, outDoc; xmlDocPtr styleDoc, doc = NULL, outDoc;
xmlChar *out = NULL; xmlChar *out = NULL;
const char *outSuffix, *errSuffix; const char *outSuffix, *errSuffix;
char *docFilename, *outFilename, *errFilename; char *docFilename, *outFilename, *errFilename;
...@@ -602,6 +602,7 @@ ...@@ -602,6 +602,7 @@
} else { } else {
docFilename = changeSuffix(filename, ".xml"); docFilename = changeSuffix(filename, ".xml");
if (!checkTestFile(docFilename)) { if (!checkTestFile(docFilename)) {
xmlFreeDoc(styleDoc);
goto out; goto out;
} }
style = xsltParseStylesheetDoc(styleDoc); style = xsltParseStylesheetDoc(styleDoc);
...@@ -632,6 +633,7 @@ ...@@ -632,6 +633,7 @@
} }
xsltFreeStylesheet(style); xsltFreeStylesheet(style);
} }
xmlFreeDoc(doc);
outFilename = changeSuffix(filename, outSuffix); outFilename = changeSuffix(filename, outSuffix);
res = compareFileMem(outFilename, (char *) out, outSize); res = compareFileMem(outFilename, (char *) out, outSize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment