You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xerces.apache.org by de...@oget.net on 2006/03/17 19:13:00 UTC

writeToString return value

What is the status of XMLCh* returned by a DocumentWriter, in terms of
memory management? Should the ressources be freed by a call to
XMLString::release or will the DocumentWriter take care of it when it is
released?

When I used XMLString::release on the return value valgrind complains that
it is using delete[] instead of delete:

==16774== Mismatched free() / delete / delete []
==16774==    at 0x1B9051E1: operator delete[](void*)
(vg_replace_malloc.c:162)
==16774==    by 0x2E489BC: xercesc_2_7::XMLString::release(unsigned
short**) (in /usr/lib/libxerces-c.so.27.0)
==16774==    by 0x8087848:
message_parser::treat_config(xercesc_2_7::DOMNode*, xercesc_2_7::DOMNode*)
(message_parser.cpp:169)
==16774==    by 0x808725D:
message_parser::treat_message(xercesc_2_7::DOMNode*)
(message_parser.cpp:77)
==16774==  Address 0x1BB383F8 is 0 bytes inside a block of size 30240 alloc'd
==16774==    at 0x1B904AFB: operator new(unsigned) (vg_replace_malloc.c:133)
==16774==    by 0x2D97603:
xercesc_2_7::MemoryManagerImpl::allocate(unsigned) (in
/usr/lib/libxerces-c.so.27.0)
==16774==    by 0x2D5CDC9:
xercesc_2_7::DOMWriterImpl::writeToString(xercesc_2_7::DOMNode const&) (in
/usr/lib/libxerces-c.so.27.0)
==16774==    by 0x8087754:
message_parser::treat_config(xercesc_2_7::DOMNode*, xercesc_2_7::DOMNode*)
(message_parser.cpp:163)

Thank you for the help