nfs4: Fix gIdMapper resource leak
Mounting another nfs4 volume loses reference to the previous idmapper service. Thanks Stephan for pointing this out.
This commit is contained in:
parent
6a6d5a80a1
commit
afc21e1367
@ -167,15 +167,17 @@ nfs4_mount(fs_volume* volume, const char* device, uint32 flags,
|
||||
|
||||
/* prepare idmapper server */
|
||||
MutexLocker locker(gIdMapperLock);
|
||||
gIdMapper = new(std::nothrow) IdMap;
|
||||
if (gIdMapper == NULL)
|
||||
return B_NO_MEMORY;
|
||||
if (gIdMapper == NULL) {
|
||||
gIdMapper = new(std::nothrow) IdMap;
|
||||
if (gIdMapper == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
result = gIdMapper->InitStatus();
|
||||
if (result != B_OK) {
|
||||
delete gIdMapper;
|
||||
gIdMapper = NULL;
|
||||
return result;
|
||||
result = gIdMapper->InitStatus();
|
||||
if (result != B_OK) {
|
||||
delete gIdMapper;
|
||||
gIdMapper = NULL;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
locker.Unlock();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user