1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2026-01-26 21:41:34 +03:00

xmllint: Fix harmless memory leaks

Fixes #892.
This commit is contained in:
Nick Wellnhofer
2025-04-17 19:10:48 +02:00
parent 21b510bc62
commit 8dbf298cc5

View File

@@ -3348,13 +3348,13 @@ xmllintMain(int argc, const char **argv, FILE *errStream,
goto error;
}
lint->wxschematron = xmlSchematronParse(ctxt);
xmlSchematronFreeParserCtxt(ctxt);
if (lint->wxschematron == NULL) {
fprintf(errStream, "Schematron schema %s failed to compile\n",
lint->schematron);
lint->progresult = XMLLINT_ERR_SCHEMACOMP;
goto error;
}
xmlSchematronFreeParserCtxt(ctxt);
if (lint->timing) {
endTimer(lint, "Compiling the schemas");
}
@@ -3381,13 +3381,13 @@ xmllintMain(int argc, const char **argv, FILE *errStream,
}
xmlRelaxNGSetResourceLoader(ctxt, xmllintResourceLoader, lint);
lint->relaxngschemas = xmlRelaxNGParse(ctxt);
xmlRelaxNGFreeParserCtxt(ctxt);
if (lint->relaxngschemas == NULL) {
fprintf(errStream, "Relax-NG schema %s failed to compile\n",
lint->relaxng);
lint->progresult = XMLLINT_ERR_SCHEMACOMP;
goto error;
}
xmlRelaxNGFreeParserCtxt(ctxt);
if (lint->timing) {
endTimer(lint, "Compiling the schemas");
}
@@ -3412,13 +3412,13 @@ xmllintMain(int argc, const char **argv, FILE *errStream,
}
xmlSchemaSetResourceLoader(ctxt, xmllintResourceLoader, lint);
lint->wxschemas = xmlSchemaParse(ctxt);
xmlSchemaFreeParserCtxt(ctxt);
if (lint->wxschemas == NULL) {
fprintf(errStream, "WXS schema %s failed to compile\n",
lint->schema);
lint->progresult = XMLLINT_ERR_SCHEMACOMP;
goto error;
}
xmlSchemaFreeParserCtxt(ctxt);
if (lint->timing) {
endTimer(lint, "Compiling the schemas");
}