1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-06 18:26:22 +03:00

0022931: Wrong delete operator in Message_Msg.cxx / Message_PrinterOStream.cxx

This commit is contained in:
Pawel, DBV 2012-02-17 08:03:59 +00:00 committed by bugmaster
parent f78c0415f7
commit 06ddeafb65
2 changed files with 3 additions and 2 deletions

View File

@ -157,7 +157,7 @@ Message_Msg& Message_Msg::Arg (const Standard_CString theString)
char * sStringBuffer = new char [Max (strlen(theString)+1, 1024)]; char * sStringBuffer = new char [Max (strlen(theString)+1, 1024)];
sprintf (sStringBuffer, aFormat.ToCString(), theString); sprintf (sStringBuffer, aFormat.ToCString(), theString);
TCollection_ExtendedString aStr ( sStringBuffer ); TCollection_ExtendedString aStr ( sStringBuffer );
delete sStringBuffer; delete [] sStringBuffer;
sStringBuffer = 0; sStringBuffer = 0;
// replace the format placeholder by the actual string // replace the format placeholder by the actual string

View File

@ -122,7 +122,8 @@ void Message_PrinterOStream::Send (const TCollection_ExtendedString &theString,
char* astr = new char[theString.LengthOfCString()+1]; char* astr = new char[theString.LengthOfCString()+1];
theString.ToUTF8CString (astr); theString.ToUTF8CString (astr);
Send ( astr, theGravity, putEndl ); Send ( astr, theGravity, putEndl );
delete astr; delete [] astr;
astr = 0;
} }
else { else {
TCollection_AsciiString aStr ( theString, '?' ); TCollection_AsciiString aStr ( theString, '?' );