From f8015fac7adc61ff8288cdd0ad226c5eec33e5d3 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Sun, 26 Jul 1998 21:31:38 +0000 Subject: [PATCH] changed the memory allocation scheme for name in xmlNewNode, Daniel. --- ChangeLog | 4 ++++ xml_tree.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d2373df..d084bd9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Jul 26 17:29:52 EDT 1998 Daniel Veillard + + * xml_tree: changed the memory allocation scheme for name in xmlNewNode + Sun Jul 26 00:17:51 EDT 1998 Daniel Veillard * configure.in: added test for CPP diff --git a/xml_tree.c b/xml_tree.c index 6a6da8b7..e939a474 100644 --- a/xml_tree.c +++ b/xml_tree.c @@ -194,7 +194,7 @@ void xmlFreeProp(xmlPropPtr cur) { /* * Creation of a new node element in a given DTD. - * We assume that the "name" has already being strdup'd ! + * We don't assume that the "name" has already being strdup'd anymore ! */ xmlNodePtr xmlNewNode(xmlDtdPtr dtd, const CHAR *name, CHAR *content) { xmlNodePtr cur; @@ -218,7 +218,7 @@ xmlNodePtr xmlNewNode(xmlDtdPtr dtd, const CHAR *name, CHAR *content) { cur->childs = NULL; cur->properties = NULL; cur->type = 0; - cur->name = name; + cur->name = xmlStrdup(name); cur->dtd = dtd; if (content != NULL) cur->content = xmlStrdup(content);