mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-01-27 14:03:36 +03:00
schemas: Fix memory leak in xmlSchemaValidateStream
Regressed in 9a82b94a. Fixes #530.
This commit is contained in:
parent
0ffc2d82b5
commit
57d88da675
15
xmlschemas.c
15
xmlschemas.c
@ -29098,9 +29098,18 @@ xmlSchemaValidateStream(xmlSchemaValidCtxtPtr ctxt,
|
||||
/*
|
||||
* prepare the parser
|
||||
*/
|
||||
pctxt = xmlNewSAXParserCtxt(sax, user_data);
|
||||
if (pctxt == NULL)
|
||||
return (-1);
|
||||
if (sax != NULL) {
|
||||
pctxt = xmlNewSAXParserCtxt(sax, user_data);
|
||||
if (pctxt == NULL)
|
||||
return (-1);
|
||||
} else {
|
||||
pctxt = xmlNewParserCtxt();
|
||||
if (pctxt == NULL)
|
||||
return (-1);
|
||||
/* We really want pctxt->sax to be NULL here. */
|
||||
xmlFree(pctxt->sax);
|
||||
pctxt->sax = NULL;
|
||||
}
|
||||
#if 0
|
||||
if (options)
|
||||
xmlCtxtUseOptions(pctxt, options);
|
||||
|
Loading…
x
Reference in New Issue
Block a user