mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
xmllint: Fix memory leak in error case
This commit is contained in:
parent
fbaacfe223
commit
0f4d36e055
10
xmllint.c
10
xmllint.c
@ -2578,6 +2578,9 @@ parseAndPrintFile(const char *filename, xmlParserCtxtPtr pctxt) {
|
||||
xmlDebugDumpEntities(ERR_STREAM, doc);
|
||||
#endif
|
||||
|
||||
/* Avoid unused label warning */
|
||||
goto done;
|
||||
|
||||
done:
|
||||
/*
|
||||
* free it.
|
||||
@ -3490,6 +3493,9 @@ xmllintMain(int argc, const char **argv, xmlResourceLoader loader) {
|
||||
usage(ERR_STREAM, argv[0]);
|
||||
progresult = XMLLINT_ERR_UNCLASS;
|
||||
}
|
||||
|
||||
error:
|
||||
|
||||
#ifdef LIBXML_SCHEMATRON_ENABLED
|
||||
if (wxschematron != NULL)
|
||||
xmlSchematronFree(wxschematron);
|
||||
@ -3505,10 +3511,6 @@ xmllintMain(int argc, const char **argv, xmlResourceLoader loader) {
|
||||
xmlFreePattern(patternc);
|
||||
#endif
|
||||
|
||||
/* Avoid unused label warning if features are disabled. */
|
||||
goto error;
|
||||
|
||||
error:
|
||||
xmlCleanupParser();
|
||||
|
||||
return(progresult);
|
||||
|
Loading…
x
Reference in New Issue
Block a user