Commit d54fa3ef authored by Daniel Veillard's avatar Daniel Veillard
Browse files

found and fixed a couple of allocation bugs Daniel

* parser.c valid.c: found and fixed a couple of allocation bugs
Daniel
parent 6dbcaf86
Wed Feb 20 17:47:55 CET 2002 Daniel Veillard <daniel@veillard.com>
* parser.c valid.c: found and fixed a couple of allocation bugs
Wed Feb 20 15:36:03 CET 2002 Daniel Veillard <daniel@veillard.com>
* doc/xml.html doc/python.html doc/*: added a Python and binding
......
......@@ -4349,10 +4349,7 @@ xmlParseElementChildrenContentDecl
type);
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
if ((op != NULL) && (op != ret))
xmlFreeElementContent(op);
if ((last != NULL) && (last != ret) &&
(last != ret->c1) && (last != ret->c2))
if ((last != NULL) && (last != ret))
xmlFreeElementContent(last);
if (ret != NULL)
xmlFreeElementContent(ret);
......@@ -4362,6 +4359,8 @@ xmlParseElementChildrenContentDecl
op = xmlNewElementContent(NULL, XML_ELEMENT_CONTENT_SEQ);
if (op == NULL) {
if ((last != NULL) && (last != ret))
xmlFreeElementContent(last);
xmlFreeElementContent(ret);
return(NULL);
}
......@@ -4394,10 +4393,7 @@ xmlParseElementChildrenContentDecl
type);
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
if ((op != NULL) && (op != ret) && (op != last))
xmlFreeElementContent(op);
if ((last != NULL) && (last != ret) &&
(last != ret->c1) && (last != ret->c2))
if ((last != NULL) && (last != ret))
xmlFreeElementContent(last);
if (ret != NULL)
xmlFreeElementContent(ret);
......@@ -4407,10 +4403,7 @@ xmlParseElementChildrenContentDecl
op = xmlNewElementContent(NULL, XML_ELEMENT_CONTENT_OR);
if (op == NULL) {
if ((op != NULL) && (op != ret))
xmlFreeElementContent(op);
if ((last != NULL) && (last != ret) &&
(last != ret->c1) && (last != ret->c2))
if ((last != NULL) && (last != ret))
xmlFreeElementContent(last);
if (ret != NULL)
xmlFreeElementContent(ret);
......@@ -4438,11 +4431,6 @@ xmlParseElementChildrenContentDecl
"xmlParseElementChildrenContentDecl : ',' '|' or ')' expected\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
if ((op != NULL) && (op != ret))
xmlFreeElementContent(op);
if ((last != NULL) && (last != ret) &&
(last != ret->c1) && (last != ret->c2))
xmlFreeElementContent(last);
if (ret != NULL)
xmlFreeElementContent(ret);
return(NULL);
......@@ -4466,11 +4454,6 @@ xmlParseElementChildrenContentDecl
"xmlParseElementChildrenContentDecl : Name or '(' expected\n");
ctxt->wellFormed = 0;
ctxt->disableSAX = 1;
if ((op != NULL) && (op != ret))
xmlFreeElementContent(op);
if ((last != NULL) && (last != ret) &&
(last != ret->c1) && (last != ret->c2))
xmlFreeElementContent(last);
if (ret != NULL)
xmlFreeElementContent(ret);
return(NULL);
......
......@@ -421,6 +421,7 @@ xmlNewElementContent(xmlChar *name, xmlElementContentType type) {
"xmlNewElementContent : out of memory!\n");
return(NULL);
}
memset(ret, 0, sizeof(xmlElementContent));
ret->type = type;
ret->ocur = XML_ELEMENT_CONTENT_ONCE;
if (name != NULL) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment