DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22441>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22441

ReaderMgr may delete fCurReader twice

           Summary: ReaderMgr may delete fCurReader twice
           Product: Xerces-C++
           Version: 2.2.0
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: SAX/SAX2
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


In the function IGXMLScanner::scanDocument(const InputSource& src), if the 
call:

        // Reset the reader manager to close all files, sockets, etc...
        fReaderMgr.reset();

throws it goes to one of the catches which calls it again, such as:

        catch(...)
        {
            // Flush the reader manager and rethrow user's error
            fReaderMgr.reset();
            throw;
        }

This is a problem in the reset function because if the "delete fCurReader" 
line throws fCurReader is not set to 0, and the second call to reset attempts 
to delete it again.

void ReaderMgr::reset()
{
    // Reset all of the flags
    fThrowEOE = false;

    // Delete the current reader and flush the reader stack
    delete fCurReader;   // <--- derived class threw
    fCurReader = 0;


It seems that fCurReader should be set to 0 before attempting the delete.

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

Reply via email to