1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

- valid.c tree.c parserInternals.c parser.c: Stephan Kulow

provided another failing case found in KDE, the way the
  ctxt->vctxt.nodeTab was allocated and freed changed over
  time but it wasn't completely cleaned up. This should fix it.
Daniel
This commit is contained in:
Daniel Veillard
2001-06-19 11:07:54 +00:00
parent 3ed27bdef0
commit a9142e74c5
5 changed files with 24 additions and 17 deletions

View File

@ -38,6 +38,7 @@ scope int name##VPush(xmlValidCtxtPtr ctxt, type value) { \
if (ctxt->name##Tab == NULL) { \
xmlGenericError(xmlGenericErrorContext, \
"malloc failed !\n"); \
ctxt->name##Max = 0; \
return(0); \
} \
} \
@ -3699,6 +3700,8 @@ xmlValidateElementContent(xmlValidCtxtPtr ctxt, xmlNodePtr child,
/*
* The first entry in the stack is reserved to the current state
*/
ctxt->nodeMax = 0;
ctxt->nodeNr = 0;
ctxt->nodeTab = NULL;
ctxt->vstate = &ctxt->vstateTab[0];
ctxt->vstateNr = 1;
@ -3829,6 +3832,7 @@ done:
ctxt->vstateTab = NULL;
}
ctxt->nodeMax = 0;
ctxt->nodeNr = 0;
if (ctxt->nodeTab != NULL) {
xmlFree(ctxt->nodeTab);
ctxt->nodeTab = NULL;