Hello there, I’m rather new to libxml and to this
mailing list. I’m writing a Linux daemon in C++ that deals with XML
requests and I’m having a problem with memory clean up after parsing my
request document. I have flipped through the documentation online but was not
able to find anything that helped me out. Here is how my code basically works: xmlDocPtr doc; xmlNodePtr cur; doc = xmlReadMemory( buffer, byte_count, “response.xml”,
NULL, 0 ); if( doc == NULL ) { /* Error handeling */ Delete( buffer ); xmlCleanupParser(); } cur = doc->children; if( cur == NULL ) { /* handle error */ xmlFreeDoc( doc ); xmlCleanupParser(); ….. } cur = cur->children; if( cur == NULL ) { /* handle error */ xmlFreeNodeList( cur ); xmlFreeDoc( doc ); xmlCleanupParser(); ….. } While( cur != NULL ) { /* process document */ cur = cur->next; } delete( buffer ); xmlFreeNodeList( cur ); xmlFreeDoc( doc ); xmlCleanupParser(); xmlCleanupGlobals(); return; Thanks for any assistance! Carlo Razzeto (313) 580-1399 --- |