Skip to content

Commit 849fa7f

Browse files
committed
[NTFS] Rewrite ReleaseAttributeContext() so that its null checks are consistent
CID 1427067
1 parent 007d3d3 commit 849fa7f

File tree

1 file changed

+6
-4
lines changed
  • drivers/filesystems/ntfs

1 file changed

+6
-4
lines changed

drivers/filesystems/ntfs/mft.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,13 +105,15 @@ PrepareAttributeContext(PNTFS_ATTR_RECORD AttrRecord)
105105
VOID
106106
ReleaseAttributeContext(PNTFS_ATTR_CONTEXT Context)
107107
{
108-
if (Context->pRecord->IsNonResident)
108+
if (Context->pRecord)
109109
{
110-
FsRtlUninitializeLargeMcb(&Context->DataRunsMCB);
111-
}
110+
if (Context->pRecord->IsNonResident)
111+
{
112+
FsRtlUninitializeLargeMcb(&Context->DataRunsMCB);
113+
}
112114

113-
if(Context->pRecord)
114115
ExFreePoolWithTag(Context->pRecord, TAG_NTFS);
116+
}
115117

116118
ExFreePoolWithTag(Context, TAG_NTFS);
117119
}

0 commit comments

Comments
 (0)