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:
Pawel Dziepak
2014-02-21 04:19:00 +01:00
parent 6a6d5a80a1
commit afc21e1367
@@ -167,6 +167,7 @@ nfs4_mount(fs_volume* volume, const char* device, uint32 flags,
/* prepare idmapper server */ /* prepare idmapper server */
MutexLocker locker(gIdMapperLock); MutexLocker locker(gIdMapperLock);
if (gIdMapper == NULL) {
gIdMapper = new(std::nothrow) IdMap; gIdMapper = new(std::nothrow) IdMap;
if (gIdMapper == NULL) if (gIdMapper == NULL)
return B_NO_MEMORY; return B_NO_MEMORY;
@@ -177,6 +178,7 @@ nfs4_mount(fs_volume* volume, const char* device, uint32 flags,
gIdMapper = NULL; gIdMapper = NULL;
return result; return result;
} }
}
locker.Unlock(); locker.Unlock();
AddressResolver* resolver; AddressResolver* resolver;