nfs4: FileSystem::~FileSystem() make sure fServer is valid
This commit is contained in:
parent
17381b7f37
commit
f87dd6dceb
@ -30,6 +30,7 @@ FileSystem::FileSystem(const MountConfiguration& configuration)
|
||||
fNamedAttrs(true),
|
||||
fPath(NULL),
|
||||
fRoot(NULL),
|
||||
fServer(NULL),
|
||||
fId(1),
|
||||
fConfiguration(configuration)
|
||||
{
|
||||
@ -44,9 +45,12 @@ FileSystem::FileSystem(const MountConfiguration& configuration)
|
||||
|
||||
FileSystem::~FileSystem()
|
||||
{
|
||||
NFS4Server* server = reinterpret_cast<NFS4Server*>(fServer->PrivateData());
|
||||
if (server != NULL)
|
||||
server->RemoveFileSystem(this);
|
||||
if (fServer != NULL) {
|
||||
NFS4Server* server
|
||||
= reinterpret_cast<NFS4Server*>(fServer->PrivateData());
|
||||
if (server != NULL)
|
||||
server->RemoveFileSystem(this);
|
||||
}
|
||||
|
||||
mutex_destroy(&fDelegationLock);
|
||||
mutex_destroy(&fOpenLock);
|
||||
|
Loading…
Reference in New Issue
Block a user