You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by "Gareth Reakes (JIRA)" <xe...@xml.apache.org> on 2005/03/17 12:06:26 UTC

[jira] Closed: (XERCESC-1378) wrong string destruction in MemBufInputSource::~MemBufInputSource()

     [ http://issues.apache.org/jira/browse/XERCESC-1378?page=history ]
     
Gareth Reakes closed XERCESC-1378:
----------------------------------

    Resolution: Fixed

> 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: xerces-c-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-c-dev-help@xml.apache.org