List Info

Thread: memory management issues




memory management issues
user name
2006-12-05 10:39:40
I have been looking through the Docs and the API, and I'm
not entirely
sure if I am adequately freeing all of the memory that
libxml is
using.  valgrind is

I am calling xmlParseMemory on a buffer of xml input that I
get back
from a curl call, and calling xmlDocGetRootElement and
looking for
various nodes and extracting some content.

For every xmlNodeGetContent I have an xmlFree
For every xmlParseMemory I have an xmlFreeDoc
Do I need anything else?

Also, I'm storing the result of xmlNodeGetContent in regular
char *,
is it okay to call simple free() on these pointers when
cleaning up?
Or does xmlFree do something that free() doesn't?

Thanks for any help.
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
memory management issues
user name
2006-12-05 12:22:57
On 12/5/06, Nicholas Aaron Philbrook <appleshampooidgmail.com> wrote:
> Also, I'm storing the result of xmlNodeGetContent in
regular char *,
> is it okay to call simple free() on these pointers when
cleaning up?
> Or does xmlFree do something that free() doesn't?

By default, xmllFree() is a wrapper around free().
But it may be overriden by xmlMemSetup() or xmlGcMemSetup().

-- 
Andrew W. Nosenko <andrew.w.nosenkogmail.com>
_______________________________________________
xml mailing list, project page  http://xmlsoft.org/
xmlgnome.org
http://mai
l.gnome.org/mailman/listinfo/xml
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )