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

fix a problem with previous patch to testapi.c Daniel

* gentest.py testapi.c: fix a problem with previous patch to
  testapi.c
Daniel
This commit is contained in:
Daniel Veillard
2005-07-03 22:40:26 +00:00
parent 7e21fd108c
commit 7e33dbaa0e
3 changed files with 7 additions and 4 deletions

View File

@@ -1,3 +1,8 @@
Mon Jul 4 00:39:35 CEST 2005 Daniel Veillard <daniel@veillard.com>
* gentest.py testapi.c: fix a problem with previous patch to
testapi.c
Sun Jul 3 23:42:31 CEST 2005 Daniel Veillard <daniel@veillard.com> Sun Jul 3 23:42:31 CEST 2005 Daniel Veillard <daniel@veillard.com>
* testapi.c tree.c: fixing a leak detected by testapi in * testapi.c tree.c: fixing a leak detected by testapi in

View File

@@ -254,6 +254,7 @@ extra_post_call = {
"xmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", "xmlParseDocument": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
"xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", "xmlParseChunk": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
"xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}", "xmlParseExtParsedEnt": "if (ctxt != NULL) {xmlFreeDoc(ctxt->myDoc); ctxt->myDoc = NULL;}",
"xmlDOMWrapAdoptNode": "if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}",
} }
modules = [] modules = []

View File

@@ -519,10 +519,6 @@ static xmlNodePtr gen_xmlNodePtr(int no, int nr ATTRIBUTE_UNUSED) {
} }
static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) { static void des_xmlNodePtr(int no, xmlNodePtr val, int nr ATTRIBUTE_UNUSED) {
if (no == 1) { if (no == 1) {
if ((val != NULL) && (val->parent == NULL)) {
xmlUnlinkNode(val);
xmlFreeNode(val);
}
free_api_doc(); free_api_doc();
} else if (val != NULL) { } else if (val != NULL) {
xmlUnlinkNode(val); xmlUnlinkNode(val);
@@ -18933,6 +18929,7 @@ test_xmlDOMWrapAdoptNode(void) {
options = gen_int(n_options, 5); options = gen_int(n_options, 5);
ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options); ret_val = xmlDOMWrapAdoptNode(ctxt, sourceDoc, node, destDoc, destParent, options);
if ((node != NULL) && (node->parent == NULL)) {xmlUnlinkNode(node);xmlFreeNode(node);node = NULL;}
desret_int(ret_val); desret_int(ret_val);
call_tests++; call_tests++;
des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0); des_xmlDOMWrapCtxtPtr(n_ctxt, ctxt, 0);