mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTFS] Don't leak attributes contextes in the btree management functions
CID 1427030, 1427062
This commit is contained in:
parent
391056ba22
commit
9d9cce2838
1 changed files with 15 additions and 7 deletions
|
@ -732,7 +732,8 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
DPRINT1("Filesystem corruption detected!\n");
|
||||
DestroyBTree(Tree);
|
||||
return STATUS_FILE_CORRUPT_ERROR;
|
||||
Status = STATUS_FILE_CORRUPT_ERROR;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
// Start at the first node entry
|
||||
|
@ -749,7 +750,8 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
DPRINT1("ERROR: Couldn't allocate memory for next key!\n");
|
||||
DestroyBTree(Tree);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
RootNode->KeyCount++;
|
||||
|
@ -763,7 +765,8 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
DPRINT1("ERROR: Couldn't allocate memory for next key!\n");
|
||||
DestroyBTree(Tree);
|
||||
return STATUS_INSUFFICIENT_RESOURCES;
|
||||
Status = STATUS_INSUFFICIENT_RESOURCES;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
RtlZeroMemory(NextKey, sizeof(B_TREE_KEY));
|
||||
|
@ -786,7 +789,8 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
DPRINT1("ERROR: Couldn't create child node!\n");
|
||||
DestroyBTree(Tree);
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
Status = STATUS_NOT_IMPLEMENTED;
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -813,7 +817,8 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
{
|
||||
DPRINT1("ERROR: Couldn't create child node!\n");
|
||||
DestroyBTree(Tree);
|
||||
return STATUS_NOT_IMPLEMENTED;
|
||||
Status = STATUS_NOT_IMPLEMENTED;
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -822,11 +827,13 @@ CreateBTreeFromIndex(PDEVICE_EXTENSION Vcb,
|
|||
}
|
||||
|
||||
*NewTree = Tree;
|
||||
Status = STATUS_SUCCESS;
|
||||
|
||||
Cleanup:
|
||||
if (IndexAllocationContext)
|
||||
ReleaseAttributeContext(IndexAllocationContext);
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
return Status;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1242,6 +1249,7 @@ UpdateIndexAllocation(PDEVICE_EXTENSION DeviceExt,
|
|||
if (!NT_SUCCESS(Status))
|
||||
{
|
||||
DPRINT1("ERROR: Failed to add index bitmap!\n");
|
||||
ReleaseAttributeContext(IndexAllocationContext);
|
||||
return Status;
|
||||
}
|
||||
|
||||
|
@ -2019,4 +2027,4 @@ SplitBTreeNode(PB_TREE Tree,
|
|||
#endif
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue