* Fixed CID 1703: buffer could be leaked. Thanks to Stefano for the note.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38191 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2010-08-17 15:21:39 +00:00
parent 9602d07543
commit 579e19f5b9

View File

@ -582,8 +582,10 @@ BlockAllocator::InitializeAndClearBitmap(Transaction& transaction)
for (int32 i = 0; i < fNumGroups; i++) {
if (write_pos(fVolume->Device(), offset << blockShift, buffer,
fBlocksPerGroup << blockShift) < B_OK)
fBlocksPerGroup << blockShift) < B_OK) {
free(buffer);
return B_ERROR;
}
// the last allocation group may contain less blocks than the others
if (i == fNumGroups - 1) {