[ http://issues.apache.org/jira/browse/XERCESC-1451?page=all ]
     
Alberto Massari closed XERCESC-1451:
------------------------------------

    Resolution: Invalid

> Valgrind reports mismatched new/delete[] usage
> ----------------------------------------------
>
>          Key: XERCESC-1451
>          URL: http://issues.apache.org/jira/browse/XERCESC-1451
>      Project: Xerces-C++
>         Type: Bug
>     Versions: 2.5.0, 2.6.0
>  Environment: Red Hat 9 (Shrike 2.4.20-6smp), Dell Precision 530
> Valgrind 2.4.0
> g++ 3.2.2
>     Reporter: Glenn Miyake

>
> Valgrind reports a mismatch new/delete[] 
> MemoryManagerImpl::allocate(unsigned) appears to allocate using just 
> new(size).
> This memory is then incorrectly freed using array delete (delete []) in 
> XMLString::release.
> Simply changing the release method to call "delete" does not work since it 
> appears that release is also used to free memory allocated with new [].
> Partial valgrind output follows:
> ==21267== Mismatched free() / delete / delete []
> ==21267==    at 0x1B903D5D: operator delete[](void*) (vg_replace_malloc.c:161)
> ==21267==    by 0x1BB0A9EC: xercesc_2_6::XMLString::release(unsigned short**) 
> (in /home/gmiyake/dev/xerces-c-src_2_6_0/lib/libxerces-c.so.26.0)
> ==21267==    by 0x836BC59: 
> altova::CDoc::convertXmlDocToString(altova::CNode&) (Doc.cpp:451)
> ==21267==    by 0x836E059: altova::CNode::convertXmlDocToString() 
> (Node.cpp:469)
> ==21267==  Address 0x1BE20C18 is 0 bytes inside a block of size 3912 alloc'd
> ==21267==    at 0x1B9036A6: operator new(unsigned) (vg_replace_malloc.c:132)
> ==21267==    by 0x1BA7C51B: 
> xercesc_2_6::MemoryManagerImpl::allocate(unsigned) (in 
> /home/gmiyake/dev/xerces-c-src_2_6_0/lib/libxerces-c.so.26.0)
> ==21267==    by 0x1BA49F0A: 
> xercesc_2_6::DOMWriterImpl::writeToString(xercesc_2_6::DOMNode const&) (in 
> /home/gmiyake/dev/xerces-c-src_2_6_0/lib/libxerces-c.so.26.0)
> ==21267==    by 0x836BC23: 
> altova::CDoc::convertXmlDocToString(altova::CNode&) (Doc.cpp:440)
> ==21267==    by 0x836E059: altova::CNode::convertXmlDocToString() 
> (Node.cpp:469)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to