From 77851710aba3a0effdc6af67ea4caf212307420c Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Tue, 27 Feb 2001 21:54:07 +0000 Subject: [PATCH] Minimal changes for XSLT node-set() extra function: - tree.c: minor doc fix - xpath.c: deallocation issues when a result tree has been converted to a node-set Daniel --- ChangeLog | 6 ++++++ tree.c | 2 +- xpath.c | 11 +++++++++-- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ba430d1..8d564df6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Wed Feb 28 00:43:58 CET 2001 Daniel Veillard + + * tree.c: minor doc fix + * xpath.c: deallocation issues when a result tree has been + converted to a node-set + Mon Feb 26 22:09:45 CET 2001 Daniel Veillard * doc/xml.html: oops corrected dates s/2000/2001 diff --git a/tree.c b/tree.c index 42acf7c8..a33658e2 100644 --- a/tree.c +++ b/tree.c @@ -3658,7 +3658,7 @@ xmlGetNsList(xmlDocPtr doc, xmlNodePtr node) { * xmlSearchNs: * @doc: the document * @node: the current node - * @nameSpace: the namespace string + * @nameSpace: the namespace prefix * * Search a Ns registered under a given name space for a document. * recurse on the parents until it finds the defined namespace diff --git a/xpath.c b/xpath.c index ff7a89b3..1bc30e65 100644 --- a/xpath.c +++ b/xpath.c @@ -999,6 +999,7 @@ xmlXPathNewNodeSet(xmlNodePtr val) { } memset(ret, 0 , (size_t) sizeof(xmlXPathObject)); ret->type = XPATH_NODESET; + ret->boolval = 0; ret->nodesetval = xmlXPathNodeSetCreate(val); return(ret); } @@ -1586,8 +1587,14 @@ void xmlXPathFreeObject(xmlXPathObjectPtr obj) { if (obj == NULL) return; if (obj->type == XPATH_NODESET) { - if (obj->nodesetval != NULL) - xmlXPathFreeNodeSet(obj->nodesetval); + if (obj->boolval) { + obj->type = XPATH_XSLT_TREE; + if (obj->nodesetval != NULL) + xmlXPathFreeValueTree(obj->nodesetval); + } else { + if (obj->nodesetval != NULL) + xmlXPathFreeNodeSet(obj->nodesetval); + } #ifdef LIBXML_XPTR_ENABLED } else if (obj->type == XPATH_LOCATIONSET) { if (obj->user != NULL)