1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-10-23 01:52:48 +03:00

had to fix generation and rebuild. the testapi found a bug in the last

* gentest.py testapi.c: had to fix generation and rebuild.
* valid.c: the testapi found a bug in the last code of course !
Daniel
This commit is contained in:
Daniel Veillard
2005-01-26 00:04:52 +00:00
parent 2ae13382c3
commit c394f73476
4 changed files with 11 additions and 2 deletions

View File

@@ -1,3 +1,8 @@
Wed Jan 26 01:03:37 CET 2005 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: had to fix generation and rebuild.
* valid.c: the testapi found a bug in the last code of course !
Wed Jan 26 00:43:05 CET 2005 Daniel Veillard <daniel@veillard.com> Wed Jan 26 00:43:05 CET 2005 Daniel Veillard <daniel@veillard.com>
* Makefile.am testapi.c doc/Makefile.am: fixing the way testapi.c * Makefile.am testapi.c doc/Makefile.am: fixing the way testapi.c

View File

@@ -231,6 +231,8 @@ extra_post_call = {
(ret_val != prefix) && (ret_val != memory)) (ret_val != prefix) && (ret_val != memory))
xmlFree(ret_val); xmlFree(ret_val);
ret_val = NULL;""", ret_val = NULL;""",
"xmlNewDocElementContent":
"""xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;""",
"xmlDictReference": "xmlDictFree(dict);", "xmlDictReference": "xmlDictFree(dict);",
# Functions which deallocates one of their parameters # Functions which deallocates one of their parameters
"xmlXPathConvertBoolean": """val = NULL;""", "xmlXPathConvertBoolean": """val = NULL;""",

View File

@@ -24401,6 +24401,7 @@ test_xmlNewDocElementContent(void) {
type = gen_xmlElementContentType(n_type, 2); type = gen_xmlElementContentType(n_type, 2);
ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type); ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type);
xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;
desret_xmlElementContentPtr(ret_val); desret_xmlElementContentPtr(ret_val);
call_tests++; call_tests++;
des_xmlDocPtr(n_doc, doc, 0); des_xmlDocPtr(n_doc, doc, 0);

View File

@@ -1547,8 +1547,9 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt,
* and flag it by setting a special parent value * and flag it by setting a special parent value
* so the parser doesn't unallocate it. * so the parser doesn't unallocate it.
*/ */
if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || if ((ctxt != NULL) &&
(ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) ||
(ctxt->finishDtd == XML_CTXT_FINISH_DTD_1))) {
ret->content = content; ret->content = content;
if (content != NULL) if (content != NULL)
content->parent = (xmlElementContentPtr) 1; content->parent = (xmlElementContentPtr) 1;