0022931: Wrong delete operator in Message_Msg.cxx / Message_PrinterOStream.cxx
authorPawel, DBV <>
Fri, 17 Feb 2012 08:03:59 +0000 (08:03 +0000)
committerbugmaster <bugmaster@opencascade.com>
Mon, 5 Mar 2012 15:32:38 +0000 (19:32 +0400)
src/Message/Message_Msg.cxx
src/Message/Message_PrinterOStream.cxx

index 87c8ef9..7268c79 100755 (executable)
@@ -157,7 +157,7 @@ Message_Msg& Message_Msg::Arg (const Standard_CString theString)
   char * sStringBuffer = new char [Max (strlen(theString)+1, 1024)];
   sprintf (sStringBuffer, aFormat.ToCString(), theString);
   TCollection_ExtendedString aStr ( sStringBuffer );
-  delete sStringBuffer;
+  delete [] sStringBuffer;
   sStringBuffer = 0;
 
   // replace the format placeholder by the actual string
index b74b18f..93cd194 100755 (executable)
@@ -122,7 +122,8 @@ void Message_PrinterOStream::Send (const TCollection_ExtendedString &theString,
     char* astr = new char[theString.LengthOfCString()+1];
     theString.ToUTF8CString (astr);
     Send ( astr, theGravity, putEndl );
-    delete astr;
+    delete [] astr;
+    astr = 0;
   }
   else {
     TCollection_AsciiString aStr ( theString, '?' );