From 279c4411fa166352732f0a5f39dafe596a5d37de Mon Sep 17 00:00:00 2001 From: Pierre Schweitzer Date: Sat, 16 May 2015 10:23:55 +0000 Subject: [PATCH] [NTFS] Fix memory leaks svn path=/trunk/; revision=67764 --- reactos/drivers/filesystems/ntfs/rw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/reactos/drivers/filesystems/ntfs/rw.c b/reactos/drivers/filesystems/ntfs/rw.c index f51f505baa2..1c7e0d02c29 100644 --- a/reactos/drivers/filesystems/ntfs/rw.c +++ b/reactos/drivers/filesystems/ntfs/rw.c @@ -101,6 +101,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt, if (FileRecord == NULL) { DPRINT1("Not enough memory!\n"); + if (AllocatedBuffer) + { + ExFreePoolWithTag(ReadBuffer, TAG_NTFS); + } return STATUS_INSUFFICIENT_RESOURCES; } @@ -109,6 +113,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt, { DPRINT1("Can't find record!\n"); ExFreePoolWithTag(FileRecord, TAG_NTFS); + if (AllocatedBuffer) + { + ExFreePoolWithTag(ReadBuffer, TAG_NTFS); + } return Status; } @@ -117,6 +125,10 @@ NtfsReadFile(PDEVICE_EXTENSION DeviceExt, { DPRINT1("No data associated with file!\n"); ExFreePoolWithTag(FileRecord, TAG_NTFS); + if (AllocatedBuffer) + { + ExFreePoolWithTag(ReadBuffer, TAG_NTFS); + } return Status; }