MantisBT - VTK
View Issue Details
0002698VTK(No Category)public2006-01-09 12:082016-07-06 09:17
Sebastien Valette 
T.J. Corona 
normalminoralways
closedfixed 
 
 
0002698: memory leak in vtkMath::SolveLeastSquares
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
No tags attached.
Issue History
2008-11-30 09:14Mathieu MalaterreAssigned ToMathieu Malaterre => François Bertel
2010-09-07 13:46François BertelAssigned ToFrançois Bertel =>
2011-06-16 13:11Zack GalbreathCategory => (No Category)
2015-12-14 11:15T.J. CoronaAssigned To => T.J. Corona
2015-12-14 11:15T.J. CoronaStatusexpired => backlog
2015-12-14 11:15T.J. CoronaStatusbacklog => active development
2016-07-06 09:17T.J. CoronaNote Added: 0036155
2016-07-06 09:17T.J. CoronaStatusactive development => closed
2016-07-06 09:17T.J. CoronaResolutionopen => fixed

Notes
(0036155)
T.J. Corona   
2016-07-06 09:17   
Fixed in the following commit: https://gitlab.kitware.com/vtk/vtk/commit/66ea3751e7d9730cdc0cdeaed34f64bcfc49a89d [^]