[vtk-developers] [VTK 0013908]: Memory Leak in the following code

Mantis Bug Tracker mantis at public.kitware.com
Tue Feb 26 17:59:17 EST 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://vtk.org/Bug/view.php?id=13908 
====================================================================== 
Reported By:                Micah Chambers
Assigned To:                
====================================================================== 
Project:                    VTK
Issue ID:                   13908
Category:                   (No Category)
Reproducibility:            have not tried
Severity:                   minor
Priority:                   normal
Status:                     backlog
Project:                    TBD 
Type:                       performance 
Resolution:                 open
Fixed in Version:           
====================================================================== 
Date Submitted:             2013-02-26 17:59 EST
Last Modified:              2013-02-26 17:59 EST
====================================================================== 
Summary:                    Memory Leak in the following code
Description: 
vtkDataReader.cxx has a memory leak here: 'decoded' is allocated but never
deleted. Line 1749 of the git version.

    else 
      {    
      // read in newline
      vtkStdString s;
      my_getline(*(this->IS), s);

      for (int i=0; i<numTuples; i++) 
        {    
        for (int j=0; j<numComp; j++) 
          {    
          my_getline(*(this->IS), s);
          int length = static_cast<int>(s.length());
          char* decoded = new char[length + 1];
          int decodedLength = this->DecodeString(decoded, s.c_str());
          vtkStdString decodedStr(decoded, decodedLength);
          ((vtkStringArray*)array)->InsertNextValue(decodedStr);
          }    
        }    
      }    
    }  
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-02-26 17:59 Micah Chambers New Issue                                    
======================================================================




More information about the vtk-developers mailing list