Fix called C++ object pointer is null

Signed-off-by: Jérôme Duval <jerome.duval@gmail.com>
This commit is contained in:
Murai Takashi 2013-07-17 19:57:01 +09:00 committed by Jérôme Duval
parent 2aa0e54e4f
commit 15be2c6018

View File

@ -621,8 +621,10 @@ Inode::EmptyInode(Disk *disk, const char *name, int32 mode)
}
Inode *object = new (std::nothrow) Inode(disk, inode);
if (object == NULL)
if (object == NULL) {
free(inode);
return NULL;
}
object->AcquireBuffer();
// this must not be deleted anymore!