Memory leak in inc\MAT_Mat.gxx line 155 (OCCT 6.5.2)

Hello,

the lines

if (noofarea == 0) {
cout return;
}

do not delete the previously allocated variables: 'firstarea' and 'lastarea'. I would change the code to:

if (noofarea == 0) {
cout if(firstarea != NULL) delete [] firstarea;
if(lastarea != NULL) delete [] lastarea;
return;
}

Pawel

Paul Jimenez's picture

Minor note: delete checks for NULL already, so it's unnecessary to check for it before calling it.

Pawel's picture

yes, indeed.

Thank you Paul.

Pawel

Pawel's picture