[
http://issues.apache.org/jira/browse/XERCESC-1378?page=comments#action_60978 ]
Gareth Reakes commented on XERCESC-1378:
----------------------------------------
Hi,
My reading of the code is slightly different. BinMemInputStream does not
delete if fAdopted is set, but rather if fCopyBufToStream is set to true. If it
is true, then BinMemInputStream makes a copy in the constructor and therefore
should delete it. Since MemBufInputSource has its own copy, if fAdopted is set
it also deletes it. Do you agree?
> wrong string destruction in MemBufInputSource::~MemBufInputSource()
> -------------------------------------------------------------------
>
> Key: XERCESC-1378
> URL: http://issues.apache.org/jira/browse/XERCESC-1378
> Project: Xerces-C++
> Type: Bug
> Components: SAX/SAX2
> Versions: 2.6.0
> Environment: Any
> Reporter: Nikolay Ognyanov
>
> MemBufInputSource::~MemBufInputSource()
> {
> if (fAdopted)
> delete [] (XMLByte*)fSrcBytes;
> }
> This seems terribly wrong. Constructor initializes fSrcBytes
> with its argument srcDocBytes and this never changes, so the
> original argument string is deleted here and not a copy of it.
> Actual creation and destruction of a copy if fAdopted is set
> is handled in BinMemInputStream which is instantiated in
> MemBufInputSource::makeStream(). Therefore the code quoted
> above should be removed from the destructor and it should do
> nothing.
> Regards
> Nikolay
--
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
-
If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]