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)
|
if (operation != 0)
|
||||||
semaphore->Revert(operation);
|
semaphore->Revert(operation);
|
||||||
}
|
}
|
||||||
if (result != 0)
|
if (result != 0) {
|
||||||
|
free(operations);
|
||||||
return result;
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
// We have to wait: first enqueue the thread
|
// We have to wait: first enqueue the thread
|
||||||
// in the appropriate set waiting list, then
|
// 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());
|
semaphore->SetPid(getpid());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
free(operations);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user