View Issue Details

IDProjectCategoryView StatusLast Update
0000446Far ManagerPanel.Treepublic2007-12-25 03:14
Reporteralexmitin Assigned Tovskirdin  
PrioritynormalSeveritycrashReproducibilityalways
Status closedResolutionfixed 
Fixed in Version1.80 alpha 1 
Summary0000446: Wrong function to free memory in TreeList::SaveState()
DescriptionThere is a crash while navigating the directories on the left panel (file list) with the right panel showing the directory tree.

Steps to reproduce:
====================
1) Press Ctrl+T.
2) Press Esc to stop the directory tree reading process.
3) Answer "Yes" for the prompt "Do you really want to cancel it?"
Now, one panel shows the file list, the other panel shows the directory tree.

3) On the panel with the file list navigate to some directory that is not part of the directory tree on the other panel.

CRASH!!!

Sometimes you should repeat steps 1-3 to get the crash.


Analysis
==========
File: treelist.cpp
Line: 2074
Context:
bool TreeList::SaveState()
{
  if(SaveListData) xf_free(SaveListData); <==[bug]==
  SaveListData=NULL;
  SaveTreeCount=SaveWorkDir=0;
  if(TreeCount > 0)
  {
    SaveListData= new TreeItem[TreeCount]; <==[allocation]==
...
}

The memory for the "SaveListData" pointer is allocated with operator new and released with function xf_free(). The memory should be release with operator delete[].


Fix
========
bool TreeList::SaveState()
{
  if(SaveListData) delete[] SaveListData;
  SaveListData=NULL;
...
}
Additional InformationFAR 1.80.0.394
TagsNo tags attached.
Build395

Activities

vskirdin

2007-12-21 05:55

administrator   bugnote:0001056

после 395
т.с. непеределанный кусок от 1.7 :-)

Issue History

Date Modified Username Field Change
2007-12-18 08:42 alexmitin New Issue
2007-12-21 05:53 vskirdin Status new => assigned
2007-12-21 05:53 vskirdin Assigned To => vskirdin
2007-12-21 05:55 vskirdin Note Added: 0001056
2007-12-21 05:55 vskirdin Status assigned => feedback
2007-12-24 06:46 samlyukov Status feedback => resolved
2007-12-24 06:46 samlyukov Resolution open => fixed
2007-12-25 03:14 vskirdin Build => 395
2007-12-25 03:14 vskirdin Status resolved => closed
2007-12-25 03:14 vskirdin Fixed in Version => 1.80 alpha 1