memory leak in vtkMath::SolveLeastSquares
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
A memory leak was found in the method int vtkMath::SolveLeastSquares(int numberOfSamples, double **xt, int xOrder, double **yt, int yOrder, double **mt, int checkHomogeneous);
the intermediate variables are not released when this function returns 0; Thus, the code: ***begin code // clean up: // set up intermediate variables for (i = 0; i < xOrder; i++) { delete [] XXt[i]; delete [] XXtI[i];
delete [] XYt[i];
}
delete [] XXt; delete [] XXtI; delete [] XYt; delete [] homogenFlags;
should be inserted just before the return(0); this bug seems to be present in all the versions