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:
parent
b45e8b1ef9
commit
4498948fcf
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue