Re: [sleuthkit-users] possible memory leak
Brought to you by:
carrier
From: bryan c. <bry...@gm...> - 2013-01-25 05:35:09
|
Thanks Brian, But looking at the code of *TskFsFile *getFile(size_t a_idx)* in *TskFsDir *class, i found that structure of type *TSK_FS_FILE *is allocated using * tsk_fs_dir_get* function which is then used to create new *TskFsFile*object. While creating *TskFsFile *object, in constructor *m_opened* flag is set to false. If I immediately delete the recently *TskFsFile* object then, due to *m_opened *flag the *close *method does not work properly i.e., it does not free the * TSK_FS_FILE* structure inside the *TskFsFile* class. On Thu, Jan 24, 2013 at 8:14 PM, Brian Carrier <ca...@sl...> wrote: > The file information is all stored in the TskFsDir object (or TSK_FS_DIR in the C version). So, it won't get freed until the directory is deleted / closed. > > brian > > > > On Jan 24, 2013, at 12:58 AM, bryan cooper <bry...@gm...> wrote: > >> Hello I am using using Sleuthkit C++ wrappers in following way: >> >> TskFsInfo fsInfo; >> TskFsDir fsDir; >> int address; >> >> // initialize fsInfo, address. >> . >> // initialization complete >> >> int status = fsDir.open(&fsInfo,address); >> TskFsFile* fsFile = fsDir.getFile(index); >> // do some work >> delete fsFile; >> >> Whenever I delete the pointer fsFile, the allocated memory is not >> freed in the. Looking at the destructor of TskFile, I found that >> m_opened flag is set to false which is preventing memory deallocation. >> >> Regards, >> Bryan >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. ON SALE this month only -- learn more at: >> http://p.sf.net/sfu/learnnow-d2d >> _______________________________________________ >> sleuthkit-users mailing list >> https://lists.sourceforge.net/lists/listinfo/sleuthkit-users >> http://www.sleuthkit.org > |