You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by pe...@apache.org on 2001/07/24 22:00:33 UTC

cvs commit: xml-xerces/c/src/validators/common DFAContentModel.cpp

peiyongz    01/07/24 13:00:33

  Modified:    c/src/validators/common DFAContentModel.cpp
  Log:
  Memory Leak fix: Bugzilla #2707 reported by Francois Rioux
  
  + |                              DESCRIPTION                                   |
  + There are some memory leaks in the buildDFA method :
  +    the first QName allocated object
  +    the nodeOrgContent
  +    fHeadNode
  
  Revision  Changes    Path
  1.16      +21 -2     xml-xerces/c/src/validators/common/DFAContentModel.cpp
  
  Index: DFAContentModel.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/validators/common/DFAContentModel.cpp,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- DFAContentModel.cpp	2001/07/09 15:22:36	1.15
  +++ DFAContentModel.cpp	2001/07/24 20:00:33	1.16
  @@ -56,6 +56,15 @@
   
   /*
    * $Log: DFAContentModel.cpp,v $
  + * Revision 1.16  2001/07/24 20:00:33  peiyongz
  + * Memory Leak fix: Bugzilla #2707 reported by Francois Rioux
  + *
  + * + |                              DESCRIPTION                                   |
  + * + There are some memory leaks in the buildDFA method :
  + * +    the first QName allocated object
  + * +    the nodeOrgContent
  + * +    fHeadNode
  + *
    * Revision 1.15  2001/07/09 15:22:36  knoaman
    * complete <any> declaration.
    *
  @@ -827,9 +836,25 @@
       //  Now we can clean up all of the temporary data that was needed during
       //  DFA build.
       //
  +
  +    //
  +    // Note on memory leak: Bugzilla#2707:
  +    // ===================================
  +    // The CMBinary, pointed to by fHeadNode, will be released by 
  +    // delete fLeafList[index], which in turn, release the objects 
  +    // pointed to by nodeOrgContent and nodeEOC repectively.
  +    //
  +    // But the qname needs to be released any way.
  +    //
  +    // Adding any of the following three deletes will
  +    // cause "Unexpected exception during parsing ..." error.
  +    //
  +    // delete fHeadNode;  
  +    // delete nodeOrgContent;
  +    // delete nodeEOC;
  +    //
   
  -    // the CMBinary will be released by fLeafList[]
  -    //delete fHeadNode;
  +    delete qname;
       fHeadNode = 0;
   
       for (index = 0; index < fLeafCount; index++)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org