From: malaterre Date: Fri, 29 Aug 2003 09:47:13 +0000 (+0000) Subject: * Corrected a leak, the pSource was find thanks to valgrind. valgrind rules ! X-Git-Tag: Version0.3.1~181 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=5740f3482ac603ba6234e79a45701c2e864ee242;p=gdcm.git * Corrected a leak, the pSource was find thanks to valgrind. valgrind rules ! --- diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 5dd9fcfe..8497a5f7 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -1,4 +1,4 @@ -// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.17 2003/07/07 17:05:17 frog Exp $ +// $Header: /cvs/public/gdcm/vtk/vtkGdcmReader.cxx,v 1.18 2003/08/29 09:47:13 malaterre Exp $ // ////////////////////////////////////////////////////////////// // WARNING TODO CLENAME // Actual limitations of this code: @@ -438,6 +438,7 @@ size_t vtkGdcmReader::LoadImageInMemory( int NumPlanes = GdcmFile.GetZSize(); int LineSize = NumColumns * GdcmFile.GetPixelSize(); unsigned char * Source = (unsigned char*)GdcmFile.GetImageData(); + unsigned char * pSource = Source; //pointer for later deletion unsigned char * Destination = Dest + size - LineSize; for (int plane = 0; plane < NumPlanes; plane++) @@ -456,6 +457,9 @@ size_t vtkGdcmReader::LoadImageInMemory( UpdateProgressCount++; } } + //GetImageData allocate a (void*)malloc, remove it: + free(pSource); + return size; }