summaryrefslogtreecommitdiff
path: root/xinclude.c
diff options
context:
space:
mode:
authorMike Hommey <mh@glandium.org>2004-11-11 12:53:54 +0000
committerMike Hommey <mh@glandium.org>2004-11-11 12:53:54 +0000
commitf51dd67f3a3f472af0620391eb588eeca4533689 (patch)
tree9184c396c489196608427d5fa35814e86a1e479f /xinclude.c
parent9705f1a5e858108d21a0128556f42b25d16833cd (diff)
downloadlibxml2-f51dd67f3a3f472af0620391eb588eeca4533689.tar.gz
Load /tmp/tmp.n9GTkp/libxml2-2.6.16 intoupstream/2.6.16
packages/libxml2/branches/upstream/current.
Diffstat (limited to 'xinclude.c')
-rw-r--r--xinclude.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/xinclude.c b/xinclude.c
index 385faff..1e0a603 100644
--- a/xinclude.c
+++ b/xinclude.c
@@ -398,6 +398,9 @@ xmlXIncludeFreeContext(xmlXIncludeCtxtPtr ctxt) {
xmlFree(ctxt->txtTab);
if (ctxt->txturlTab != NULL)
xmlFree(ctxt->txturlTab);
+ if (ctxt->base != NULL) {
+ xmlFree(ctxt->base);
+ }
xmlFree(ctxt);
}
@@ -681,7 +684,7 @@ xmlXIncludeRecurseDoc(xmlXIncludeCtxtPtr ctxt, xmlDocPtr doc,
/*
* Inherit the existing base
*/
- newctxt->base = ctxt->base;
+ newctxt->base = xmlStrdup(ctxt->base);
/*
* Inherit the documents already in use by other includes
@@ -1863,7 +1866,7 @@ xmlXIncludeLoadFallback(xmlXIncludeCtxtPtr ctxt, xmlNodePtr fallback, int nr) {
newctxt = xmlXIncludeNewContext(ctxt->doc);
if (newctxt == NULL)
return (-1);
- newctxt->base = ctxt->base; /* Inherit the base from the existing context */
+ newctxt->base = xmlStrdup(ctxt->base); /* Inherit the base from the existing context */
xmlXIncludeSetFlags(newctxt, ctxt->parseFlags);
ret = xmlXIncludeDoProcess(newctxt, ctxt->doc, fallback->children);
if (ctxt->nbErrors > 0)
@@ -2372,7 +2375,7 @@ xmlXIncludeProcessFlags(xmlDocPtr doc, int flags) {
ctxt = xmlXIncludeNewContext(doc);
if (ctxt == NULL)
return(-1);
- ctxt->base = (xmlChar *)doc->URL;
+ ctxt->base = xmlStrdup((xmlChar *)doc->URL);
xmlXIncludeSetFlags(ctxt, flags);
ret = xmlXIncludeDoProcess(ctxt, doc, tree);
if ((ret >= 0) && (ctxt->nbErrors > 0))