https://git.reactos.org/?p=reactos.git;a=commitdiff;h=849fa7fbae3d73da2970f…
commit 849fa7fbae3d73da2970f0ff7d71b33fbb63e254
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Dec 31 10:36:29 2017 +0100
[NTFS] Rewrite ReleaseAttributeContext() so that its null checks are consistent
CID 1427067
---
drivers/filesystems/ntfs/mft.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/drivers/filesystems/ntfs/mft.c b/drivers/filesystems/ntfs/mft.c
index cf4f084549..f623c72e68 100644
--- a/drivers/filesystems/ntfs/mft.c
+++ b/drivers/filesystems/ntfs/mft.c
@@ -105,13 +105,15 @@ PrepareAttributeContext(PNTFS_ATTR_RECORD AttrRecord)
VOID
ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
{
- if (Context->pRecord->IsNonResident)
+ if (Context->pRecord)
{
- FsRtlUninitializeLargeMcb(&Context->DataRunsMCB);
- }
+ if (Context->pRecord->IsNonResident)
+ {
+ FsRtlUninitializeLargeMcb(&Context->DataRunsMCB);
+ }
- if(Context->pRecord)
ExFreePoolWithTag(Context->pRecord, TAG_NTFS);
+ }
ExFreePoolWithTag(Context, TAG_NTFS);
}