nfs4: Fix CID 991494: memory leak if acquiring a lock fails

This commit is contained in:
Pawel Dziepak
2013-03-21 02:48:46 +01:00
parent ce6f81f7b2
commit edb1255117
@@ -755,8 +755,10 @@ Inode::AcquireLock(OpenFileCookie* cookie, const struct flock* lock,
linfo->fType = sGetLockType(lock->l_type, wait);
result = NFS4Inode::AcquireLock(cookie, linfo, wait);
if (result != B_OK)
if (result != B_OK) {
delete linfo;
return result;
}
MutexLocker _(state->fLocksLock);
state->AddLock(linfo);