logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

[jira] Updated: (XERCESC-1218) XSerializeEngine constructors are not except: msg#00141

Subject: [jira] Updated: (XERCESC-1218) XSerializeEngine constructors are not exception-safe
The following issue has been updated:

    Updater: David Bertoni (mailto:david_n_bertoni@xxxxxxxxxx)
       Date: Wed, 19 May 2004 1:39 PM
    Comment:
Patch file.
    Changes:
             Attachment changed to patch.txt
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/XERCESC-1218?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/XERCESC-1218

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XERCESC-1218
    Summary: XSerializeEngine constructors are not exception-safe
       Type: Bug

     Status: Unassigned
   Priority: Critical

    Project: Xerces-C++
 Components: 
             Utilities
   Versions:
             Nightly build (please specify the date)

   Assignee: 
   Reporter: David Bertoni

    Created: Wed, 19 May 2004 1:37 PM
    Updated: Wed, 19 May 2004 1:39 PM
Environment: All platforms

Description:
The constructors for XSerializeEngine can leak memory if the constructor body 
throws an exception.  Because the data members fBufStart, fStorePool, and 
fLoadPool are pointers, the objects and memory they point to will not be 
destroyed or deallocated if an exception is thrown.

One way to fix this would be to make the data members Janitor and ArrayJanitor 
instances.  Another would be to ensure the constructors don't throw any 
exceptions, or to use Janitors inside the constructor and release then when 
leaving the constrcutor.

I've created a proposed patch that does two things.  For the "loading" 
constructors, it simply removes the call to fillBuffer().  This seems to work 
fine, because all of the extraction routines will detect the buffer is empty 
and fill it before they do anything.  For the "storing" constructors, I've 
created some Janitors on the stack inside the constructor bodies.




---------------------------------------------------------------------
JIRA INFORMATION:
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


<Prev in Thread] Current Thread [Next in Thread>