Author: pschweitzer
Date: Sat May 16 10:23:55 2015
New Revision: 67764
URL:
http://svn.reactos.org/svn/reactos?rev=67764&view=rev
Log:
[NTFS]
Fix memory leaks
Modified:
trunk/reactos/drivers/filesystems/ntfs/rw.c
Modified: trunk/reactos/drivers/filesystems/ntfs/rw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/r…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/rw.c [iso-8859-1] Sat May 16 10:23:55 2015
@@ -101,6 +101,10 @@
if (FileRecord == NULL)
{
DPRINT1("Not enough memory!\n");
+ if (AllocatedBuffer)
+ {
+ ExFreePoolWithTag(ReadBuffer, TAG_NTFS);
+ }
return STATUS_INSUFFICIENT_RESOURCES;
}
@@ -109,6 +113,10 @@
{
DPRINT1("Can't find record!\n");
ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ if (AllocatedBuffer)
+ {
+ ExFreePoolWithTag(ReadBuffer, TAG_NTFS);
+ }
return Status;
}
@@ -117,6 +125,10 @@
{
DPRINT1("No data associated with file!\n");
ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ if (AllocatedBuffer)
+ {
+ ExFreePoolWithTag(ReadBuffer, TAG_NTFS);
+ }
return Status;
}