diff --git a/ChangeLog b/ChangeLog index b89316f7..e48505ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Wed Jan 26 01:03:37 CET 2005 Daniel Veillard + + * 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 * Makefile.am testapi.c doc/Makefile.am: fixing the way testapi.c diff --git a/gentest.py b/gentest.py index 12dd718f..c8e675d1 100755 --- a/gentest.py +++ b/gentest.py @@ -231,6 +231,8 @@ extra_post_call = { (ret_val != prefix) && (ret_val != memory)) xmlFree(ret_val); ret_val = NULL;""", + "xmlNewDocElementContent": + """xmlFreeDocElementContent(doc, ret_val); ret_val = NULL;""", "xmlDictReference": "xmlDictFree(dict);", # Functions which deallocates one of their parameters "xmlXPathConvertBoolean": """val = NULL;""", diff --git a/testapi.c b/testapi.c index 2dd00983..bf829dc9 100644 --- a/testapi.c +++ b/testapi.c @@ -24401,6 +24401,7 @@ test_xmlNewDocElementContent(void) { type = gen_xmlElementContentType(n_type, 2); ret_val = xmlNewDocElementContent(doc, (const xmlChar *)name, type); + xmlFreeDocElementContent(doc, ret_val); ret_val = NULL; desret_xmlElementContentPtr(ret_val); call_tests++; des_xmlDocPtr(n_doc, doc, 0); diff --git a/valid.c b/valid.c index 5abdc92f..e73bd652 100644 --- a/valid.c +++ b/valid.c @@ -1547,8 +1547,9 @@ xmlAddElementDecl(xmlValidCtxtPtr ctxt, * and flag it by setting a special parent value * so the parser doesn't unallocate it. */ - if ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || - (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1)) { + if ((ctxt != NULL) && + ((ctxt->finishDtd == XML_CTXT_FINISH_DTD_0) || + (ctxt->finishDtd == XML_CTXT_FINISH_DTD_1))) { ret->content = content; if (content != NULL) content->parent = (xmlElementContentPtr) 1;