1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-01-12 09:17:37 +03:00

malloc-fail: Fix memory leak in xmlSchemaParse

Found with libFuzzer, see #344.
This commit is contained in:
Nick Wellnhofer 2023-03-05 14:06:51 +01:00
parent dbc893f588
commit cfbc1f48ee

View File

@ -21456,7 +21456,7 @@ xmlSchemaParse(xmlSchemaParserCtxtPtr ctxt)
if (ctxt->constructor == NULL) {
ctxt->constructor = xmlSchemaConstructionCtxtCreate(ctxt->dict);
if (ctxt->constructor == NULL)
return(NULL);
goto exit_failure;
/* Take ownership of the constructor to be able to free it. */
ctxt->ownsConstructor = 1;
}