[xml] xmlReconciliateNs issues?



Hi,

I am using xmlReconciliateNs and am experiencing memory leaks.  Here is what
I think is happening within the method.  The existing namespace is being
saves in oldNs, and at the end of the method oldNs is being freed through
xmlFree.  The problem I see with this is the internal members of the
existing namespace are left hanging.  I don't know whether I am using things
right, or whether this is a real issue.  Here is the snippet of code where I
am using the method:

   xml_doc = xmlNewDoc ((xmlChar*)"1.0");

   xmlNodePtr new_node = NULL;
   xmlNodePtr root_node = NULL;

   xmlNsPtr ns = xmlNewNs (NULL, (xmlChar*) "namespace_uri", (xmlChar*)
"prefix");
   root_node = xmlNewDocNode (xml_doc, ns, (xmlChar*) getTagName (), NULL);
   xmlDocSetRootElement (xml_doc, root_node);
snip..adding more nodes in here...
   xmlReconciliateNs (xml_doc, root_node);

Any help in finding this problem would be greatly appreciated.  Oh, we are
using libxml 2.6.6.

Thanks
        Daryn




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]