xmlSetProp() and xmlNewProp() fixes, mem extra alloc bug in parser fixed, Daniel
diff --git a/tree.c b/tree.c
index b5d9155..23819a1 100644
--- a/tree.c
+++ b/tree.c
@@ -753,8 +753,12 @@
cur->node = node;
cur->ns = NULL;
cur->name = xmlStrdup(name);
- if (value != NULL)
- cur->val = xmlStringGetNodeList(node->doc, value);
+ if (value != NULL) {
+ xmlChar *buffer;
+ buffer = xmlEncodeEntitiesReentrant(node->doc, value);
+ cur->val = xmlStringGetNodeList(node->doc, buffer);
+ xmlFree(buffer);
+ }
else
cur->val = NULL;
#ifndef XML_WITHOUT_CORBA
@@ -2406,8 +2410,12 @@
if (prop->val != NULL)
xmlFreeNodeList(prop->val);
prop->val = NULL;
- if (value != NULL)
- prop->val = xmlStringGetNodeList(node->doc, value);
+ if (value != NULL) {
+ xmlChar *buffer;
+ buffer = xmlEncodeEntitiesReentrant(node->doc, value);
+ prop->val = xmlStringGetNodeList(node->doc, buffer);
+ xmlFree(buffer);
+ }
return(prop);
}
prop = prop->next;