From: Pawel Date: Thu, 12 Jul 2012 09:43:42 +0000 (+0200) Subject: 0023265: cppcheck warning: Mismatching allocation and deallocation X-Git-Tag: V6_5_4_beta1~116 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=b1ea14b63c956a9cfdd8477281ab161865812117;p=occt-copy.git 0023265: cppcheck warning: Mismatching allocation and deallocation Use pairs: new - delete (new - delete [] for arrays), malloc - free --- diff --git a/src/QADNaming/QADNaming_IteratorsCommands.cxx b/src/QADNaming/QADNaming_IteratorsCommands.cxx index 4416333648..aa4bcd71e6 100755 --- a/src/QADNaming/QADNaming_IteratorsCommands.cxx +++ b/src/QADNaming/QADNaming_IteratorsCommands.cxx @@ -158,7 +158,7 @@ static Standard_Integer GetAllNewShapes (Draw_Interpretor& di, sprintf(aSubName,"%s_%d",aName,a); } else aSubName = NULL; aResult+=GetAllNew(anIter.NewShape(),aLabel,aSubName,0); - if (aSubName != NULL) delete(aSubName); + if (aSubName != NULL) delete [] aSubName; } } } else { // shape diff --git a/src/QANewModTopOpe/QANewModTopOpe.cxx b/src/QANewModTopOpe/QANewModTopOpe.cxx index 7304b80b09..86a190cc45 100755 --- a/src/QANewModTopOpe/QANewModTopOpe.cxx +++ b/src/QANewModTopOpe/QANewModTopOpe.cxx @@ -659,7 +659,7 @@ Standard_Boolean QANewModTopOpe::IsConnected(const TopoDS_Shape& TheS) if(aNotChanged) break; if(aRes) break; } - delete aMat; + delete [] aMat; // cout << "QANewModTopOpe::IsConnected END: aRes="<