Fix Coverity bug 605892: Resource leak
Signed-off-by: Jessica Hamilton <[email protected]>
This commit is contained in:
committed by
Jessica Hamilton
parent
679ad262e9
commit
d0592a1164
@@ -1158,8 +1158,10 @@ _user_xsi_semop(int semaphoreID, struct sembuf *ops, size_t numOps)
|
||||
if (operation != 0)
|
||||
semaphore->Revert(operation);
|
||||
}
|
||||
if (result != 0)
|
||||
if (result != 0) {
|
||||
free(operations);
|
||||
return result;
|
||||
}
|
||||
|
||||
// We have to wait: first enqueue the thread
|
||||
// in the appropriate set waiting list, then
|
||||
@@ -1246,5 +1248,6 @@ _user_xsi_semop(int semaphoreID, struct sembuf *ops, size_t numOps)
|
||||
semaphore->SetPid(getpid());
|
||||
}
|
||||
}
|
||||
free(operations);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user