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]

Reply via email to