mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-14 13:30:48 +03:00
0023265: cppcheck warning: Mismatching allocation and deallocation
Use pairs: new - delete (new - delete [] for arrays), malloc - free
This commit is contained in:
@@ -158,7 +158,7 @@ static Standard_Integer GetAllNewShapes (Draw_Interpretor& di,
|
|||||||
sprintf(aSubName,"%s_%d",aName,a);
|
sprintf(aSubName,"%s_%d",aName,a);
|
||||||
} else aSubName = NULL;
|
} else aSubName = NULL;
|
||||||
aResult+=GetAllNew(anIter.NewShape(),aLabel,aSubName,0);
|
aResult+=GetAllNew(anIter.NewShape(),aLabel,aSubName,0);
|
||||||
if (aSubName != NULL) delete(aSubName);
|
if (aSubName != NULL) delete [] aSubName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else { // shape
|
} else { // shape
|
||||||
|
@@ -659,7 +659,7 @@ Standard_Boolean QANewModTopOpe::IsConnected(const TopoDS_Shape& TheS)
|
|||||||
if(aNotChanged) break;
|
if(aNotChanged) break;
|
||||||
if(aRes) break;
|
if(aRes) break;
|
||||||
}
|
}
|
||||||
delete aMat;
|
delete [] aMat;
|
||||||
|
|
||||||
// cout << "QANewModTopOpe::IsConnected END: aRes="<<aRes << ";ncount="<<ncount<<endl;
|
// cout << "QANewModTopOpe::IsConnected END: aRes="<<aRes << ";ncount="<<ncount<<endl;
|
||||||
cout << "QANewModTopOpe::IsConnected END: aRes="<<aRes <<endl;
|
cout << "QANewModTopOpe::IsConnected END: aRes="<<aRes <<endl;
|
||||||
|
@@ -319,7 +319,7 @@ Standard_Integer dstrace(Draw_Interpretor& di, Standard_Integer n , const char**
|
|||||||
pa[1] = (char *)a1.ToCString();
|
pa[1] = (char *)a1.ToCString();
|
||||||
for (Standard_Integer i=1;i<n;i++) pa[i+1] = a[i];
|
for (Standard_Integer i=1;i<n;i++) pa[i+1] = a[i];
|
||||||
TestTopOpeTools_SetTrace(di,npa,pa);
|
TestTopOpeTools_SetTrace(di,npa,pa);
|
||||||
if (pa) delete [] pa;
|
if (pa) free(pa);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user