From 5740f3482ac603ba6234e79a45701c2e864ee242 Mon Sep 17 00:00:00 2001 From: malaterre Date: Fri, 29 Aug 2003 09:47:13 +0000 Subject: [PATCH] * Corrected a leak, the pSource was find thanks to valgrind. valgrind rules ! --- vtk/vtkGdcmReader.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.48.1