recover: Work around use-after-free

Inode::_FindPath() always deletes the inode it uses regardless
the source, including when it's from the HashtableInodeSource.

But the later returned the inode object directly from the hashtable
when it's inside, so it gets deleted bu _FindPath… then reused later on
when searching the hashtable again.

I'm not sure it's the correct solution but at least malloc_debug doesn't
complain anymore.
This commit is contained in:
François Revol 2018-03-27 23:14:32 +02:00
parent b45e8b1ef9
commit 4498948fcf
1 changed files with 2 additions and 2 deletions

View File

@ -185,10 +185,10 @@ public:
{
Inode *inode;
if ((inode = gLogged.Get(run)) != NULL)
return inode;
return Inode::Factory(&fDisk, inode, false);
if ((inode = gMissing.Get(run)) != NULL)
return inode;
return Inode::Factory(&fDisk, inode, false);
if (gMainInodes.find(run) == gMainInodes.end())
return NULL;