1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0023265: cppcheck warning: Mismatching allocation and deallocation

Use pairs: new - delete (new - delete [] for arrays), malloc - free
This commit is contained in:
Pawel
2012-07-12 11:43:42 +02:00
committed by Pawel Kowalski
parent 76021966ce
commit b1ea14b63c
3 changed files with 3 additions and 3 deletions

View File

@@ -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

View File

@@ -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="<<aRes << ";ncount="<<ncount<<endl;
cout << "QANewModTopOpe::IsConnected END: aRes="<<aRes <<endl;

View File

@@ -319,7 +319,7 @@ Standard_Integer dstrace(Draw_Interpretor& di, Standard_Integer n , const char**
pa[1] = (char *)a1.ToCString();
for (Standard_Integer i=1;i<n;i++) pa[i+1] = a[i];
TestTopOpeTools_SetTrace(di,npa,pa);
if (pa) delete [] pa;
if (pa) free(pa);
return 0;
}