jdonohue    00/03/20 06:33:40

  Modified:    c/src/PlatformSupport DOMStringHelper.cpp
               c/src/XPath XPathExpression.cpp
               c/src/XercesPlatformSupport TextFileOutputStream.cpp
                        XercesStdTextOutputStream.cpp
  Log:
  Fixed memory leak with ostrstream
  
  Revision  Changes    Path
  1.13      +10 -6     xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp
  
  Index: DOMStringHelper.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/PlatformSupport/DOMStringHelper.cpp,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- DOMStringHelper.cpp       2000/03/07 16:12:21     1.12
  +++ DOMStringHelper.cpp       2000/03/20 14:33:39     1.13
  @@ -729,6 +729,7 @@
                        theResult.erase(++thePosition);
                }
   
  +             delete(theFormatter.str());
                return theResult.c_str();
        }
   }
  @@ -741,8 +742,9 @@
        ostrstream      theFormatter;
   
        theFormatter << hex << theLong << '\0';
  -
  -     return theFormatter.str();
  +     DOMString theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  @@ -753,8 +755,9 @@
        ostrstream      theFormatter;
   
        theFormatter << theLong << '\0';
  -
  -     return theFormatter.str();
  +     DOMString theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  @@ -765,8 +768,9 @@
        ostrstream      theFormatter;
   
        theFormatter << theUnsignedLong << '\0';
  -
  -     return theFormatter.str();
  +     DOMString theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  
  
  
  1.3       +9 -3      xml-xalan/c/src/XPath/XPathExpression.cpp
  
  Index: XPathExpression.cpp
  ===================================================================
  RCS file: /home/cvs/xml-xalan/c/src/XPath/XPathExpression.cpp,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- XPathExpression.cpp       2000/02/18 20:33:10     1.2
  +++ XPathExpression.cpp       2000/03/20 14:33:39     1.3
  @@ -113,7 +113,9 @@
                                 << " was detected."
                                 << '\0';
   
  -     return theFormatter.str();
  +     std::string theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  @@ -156,7 +158,9 @@
                                 << " arguments(s) were supplied."
                                 << '\0';
   
  -     return theFormatter.str();
  +     std::string theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  @@ -194,7 +198,9 @@
                                 << "."
                                 << '\0';
   
  -     return theFormatter.str();
  +     std::string theString = theFormatter.str();
  +     delete theFormatter.str();
  +     return theString;
   }
   
   
  
  
  
  1.8       +1 -0      
xml-xalan/c/src/XercesPlatformSupport/TextFileOutputStream.cpp
  
  Index: TextFileOutputStream.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XercesPlatformSupport/TextFileOutputStream.cpp,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- TextFileOutputStream.cpp  2000/02/03 20:13:27     1.7
  +++ TextFileOutputStream.cpp  2000/03/20 14:33:39     1.8
  @@ -221,6 +221,7 @@
   
        theResult += theFormatter.str();
   
  +     delete theFormatter.str();
        return theResult;
   }
   
  
  
  
  1.5       +1 -0      
xml-xalan/c/src/XercesPlatformSupport/XercesStdTextOutputStream.cpp
  
  Index: XercesStdTextOutputStream.cpp
  ===================================================================
  RCS file: 
/home/cvs/xml-xalan/c/src/XercesPlatformSupport/XercesStdTextOutputStream.cpp,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- XercesStdTextOutputStream.cpp     2000/03/07 16:07:01     1.4
  +++ XercesStdTextOutputStream.cpp     2000/03/20 14:33:39     1.5
  @@ -134,6 +134,7 @@
   
        theResult += theFormatter.str();
   
  +     delete theFormatter.str();
        return theResult;
   }
   
  
  
  

Reply via email to