View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0012149 | VTK | (No Category) | public | 2011-05-04 03:34 | 2013-12-12 23:27 | ||||
Reporter | John Stark. | ||||||||
Assigned To | Robert Maynard | ||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||
Status | closed | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | |||||||||
Target Version | Fixed in Version | 6.0.0 | |||||||
Summary | 0012149: vtkDataReader: leaks memory in IsFileValid | ||||||||
Description | Not all return paths from the function given below result in the file being closed. int vtkDataReader::IsFileValid(const char *dstype) This results in a leak of a std::istream object (m_IS) every time the function is called on a broad set of files. | ||||||||
Steps To Reproduce | Call vtkDataReader::IsFileValid with a file that does not contain "dataset" on the first line. Observe that this->CloseVTKFile() is not called. | ||||||||
Additional Information | To fix, add this->CloseVTKFile(); just before the return 0; from this function. And / Or Always delete the existing m_IS in vtkDataReader::OpenVTKFile(); | ||||||||
Tags | No tags attached. | ||||||||
Project | |||||||||
Type | |||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0026429) John Stark. (reporter) 2011-05-04 07:13 |
Also, in the same function, the following test needs to be split: if (!this->OpenVTKFile() || !this->ReadHeader() ) { return 0; } In the case the file is opened, the file needs to be closed even if ReadHeader fails, to give if (!this->OpenVTKFile()) { return 0; } if ( !this->ReadHeader() ) { this->CloseVTKFile (); return 0; } |
(0027427) Benoit Bleuze (reporter) 2011-08-25 04:40 |
Hi there, I just also noticed this issue, is there any news on the matter? It is quite an easy fix, and the reporter provided a solution, but I think I haven't seen any change on the git repos so far. Thank you for any updates. |
(0027747) John Stark (reporter) 2011-11-30 04:10 |
Submitted patch to gerrit : http://review.source.kitware.com/#change,3405 [^] |
(0031926) Dave DeMarle (administrator) 2013-12-12 23:27 |
commit 46514f9 merged pre 6.0.0 |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-05-04 03:34 | John Stark. | New Issue | |
2011-05-04 07:13 | John Stark. | Note Added: 0026429 | |
2011-05-04 07:51 | David Partyka | Assigned To | => Robert Maynard |
2011-05-04 07:51 | David Partyka | Status | backlog => tabled |
2011-06-16 13:12 | Zack Galbreath | Category | Development => (No Category) |
2011-08-25 04:40 | Benoit Bleuze | Note Added: 0027427 | |
2011-11-30 04:10 | John Stark | Note Added: 0027747 | |
2013-12-12 23:27 | Dave DeMarle | Note Added: 0031926 | |
2013-12-12 23:27 | Dave DeMarle | Status | backlog => closed |
2013-12-12 23:27 | Dave DeMarle | Resolution | open => fixed |
2013-12-12 23:27 | Dave DeMarle | Fixed in Version | => 6.0.0 |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |