You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by kn...@apache.org on 2004/08/11 23:08:31 UTC

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

knoaman     2004/08/11 14:08:31

  Modified:    c/src/xercesc/validators/common MixedContentModel.cpp
  Log:
  Fixing Xerces-C crash when creating a MixedContentModel. Patch by  Andrew Fang.
  
  Revision  Changes    Path
  1.11      +7 -1      xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp
  
  Index: MixedContentModel.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xerces/c/src/xercesc/validators/common/MixedContentModel.cpp,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- MixedContentModel.cpp	29 Jan 2004 11:51:21 -0000	1.10
  +++ MixedContentModel.cpp	11 Aug 2004 21:08:31 -0000	1.11
  @@ -56,6 +56,9 @@
   
   /*
    * $Log$
  + * Revision 1.11  2004/08/11 21:08:31  knoaman
  + * Fixing Xerces-C crash when creating a MixedContentModel. Patch by  Andrew Fang.
  + *
    * Revision 1.10  2004/01/29 11:51:21  cargilld
    * Code cleanup changes to get rid of various compiler diagnostic messages.
    *
  @@ -210,13 +213,16 @@
           fCount * sizeof(ContentSpecNode::NodeTypes)
       ); //new ContentSpecNode::NodeTypes[fCount];
       for (unsigned int index = 0; index < fCount; index++) {
  -        fChildren[index] = children.elementAt(index);
  +        fChildren[index] = new (fMemoryManager) QName(*children.elementAt(index));
           fChildTypes[index] = childTypes.elementAt(index);
       }
   }
   
   MixedContentModel::~MixedContentModel()
   {
  +    for (unsigned int index = 0; index < fCount; index++) {
  +        delete fChildren[index];
  +    }
       fMemoryManager->deallocate(fChildren); //delete [] fChildren;
       fMemoryManager->deallocate(fChildTypes); //delete [] fChildTypes;
   }
  
  
  

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