Re: [xslt] xmlStrdup() do I need to free it?



On Wed, Mar 16, 2005 at 02:58:38PM -0500, Marc Respass wrote:
> Hi All, 
> 
> I recently added the libxslt library to my project. I'm writing a Mac 
> OS X app and using the libxslt.framework. I have a string of XML as a 
> Cocoa object. I can get a UTF8String from that string object but it is 
> not mutable, it's const char *. I call xmlParseDoc() with my string but 
> xmlParseDoc() wants a mutable string so I copied it with xmlStrdup(). 

  xmlParseDoc won't modify the string. This is not necessary. And it's
better to use the more recent xmlReadMemory() API anyway.

> Now I feel like I should be freeing the memory from xmlStrdup() but I 
> don't see what I should be using. I was calling xmlMemFree() but that 

  xmlFree()

Daniel

-- 
Daniel Veillard      | Red Hat Desktop team http://redhat.com/
veillard redhat com  | libxml GNOME XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | Rpmfind RPM search engine http://rpmfind.net/


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