mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
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
This commit is contained in:
11
xpath.c
11
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)
|
||||
|
Reference in New Issue
Block a user