| View Issue Details [ Jump to Notes ]  | [ Print ]  | 
| ID | Project | Category | View Status | Date Submitted | Last Update | 
| 0010899 | ITK |  | public | 2010-06-26 02:34 | 2010-07-12 14:34 | 
 | 
| Reporter | Steve Robbins |   | 
| Assigned To | Hans Johnson |   | 
| Priority | normal | Severity | major | Reproducibility | have not tried | 
| Status | closed | Resolution | fixed |   | 
| Platform |  | OS |  | OS Version |  | 
| Product Version | ITK-3-18 |   | 
| Target Version |  | Fixed in Version | ITK-3-18 |   | 
 | 
| Summary | 0010899: itkNiftiImageIO memory leak | 
| Description | A Debian user reported a memory leak when using the same NiftiImageIO object for reading multiple NIFTI files.  See http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=587200 [^] | 
| Additional Information | Patch provided by Yaroslav Halchenko <debian@onerussian.com>  | 
| Tags | No tags attached. | 
 | 
| Resolution Date |  | 
| Sprint |  | 
| Sprint Status |  | 
 | 
| Attached Files |   itk-nifti-memleak.patch [^] (407 bytes) 2010-06-26 02:34 [Show Content] [Hide Content]--- insighttoolkit-3.18.0.orig/Code/IO/itkNiftiImageIO.cxx
+++ insighttoolkit-3.18.0/Code/IO/itkNiftiImageIO.cxx
@@ -457,6 +457,10 @@
     _size[4] = numComponents;
     }
 
+  // Free memory if any was occupied already
+  if (this->m_NiftiImage != NULL)
+      nifti_image_free(this->m_NiftiImage);
+
   //
   // allocate nifti image...
   this->m_NiftiImage = nifti_image_read(this->GetFileName(),false);
 | 
 |