https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2d3d74151b77ec6c59414…
commit 2d3d74151b77ec6c59414616b88634698317bb87
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Sun Dec 31 14:18:02 2017 +0100
[NTFS] Fix a memory leak on error
CID 1427053
---
drivers/filesystems/ntfs/mft.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/filesystems/ntfs/mft.c b/drivers/filesystems/ntfs/mft.c
index 4724e8d899..515abf7a4f 100644
--- a/drivers/filesystems/ntfs/mft.c
+++ b/drivers/filesystems/ntfs/mft.c
@@ -948,6 +948,7 @@ SetResidentAttributeDataLength(PDEVICE_EXTENSION Vcb,
DPRINT1("Unable to create LargeMcb!\n");
if (AttribDataSize.QuadPart > 0)
ExFreePoolWithTag(AttribData, TAG_NTFS);
+ ExFreePoolWithTag(NewRecord, TAG_NTFS);
_SEH2_YIELD(return _SEH2_GetExceptionCode());
} _SEH2_END;
@@ -961,6 +962,7 @@ SetResidentAttributeDataLength(PDEVICE_EXTENSION Vcb,
DPRINT1("ERROR: Couldn't update file record to continue
migration!\n");
if (AttribDataSize.QuadPart > 0)
ExFreePoolWithTag(AttribData, TAG_NTFS);
+ ExFreePoolWithTag(NewRecord, TAG_NTFS);
return Status;
}