Author: pschweitzer
Date: Fri Oct 17 06:55:52 2014
New Revision: 64776
URL:
http://svn.reactos.org/svn/reactos?rev=64776&view=rev
Log:
[NTFS]
Bugfixing... Part 3/X:
- Really release the allocated memory in NtfsFindFileAt() and NtfsLookupFileAt().
Don't attempt to release caller pointer!
This fixes crashes on directory enumeration failure. Even though this latter still
doesn't work.
Modified:
trunk/reactos/drivers/filesystems/ntfs/mft.c
Modified: trunk/reactos/drivers/filesystems/ntfs/mft.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/filesystems/ntfs/m…
==============================================================================
--- trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/filesystems/ntfs/mft.c [iso-8859-1] Fri Oct 17 06:55:52 2014
@@ -397,6 +397,8 @@
{
ULONGLONG BytesRead;
+ DPRINT1("ReadFileRecord(%p, %I64x, %p)\n", Vcb, index, file);
+
BytesRead = ReadAttribute(Vcb, Vcb->MFTContext, index *
Vcb->NtfsInfo.BytesPerFileRecord, (PCHAR)file, Vcb->NtfsInfo.BytesPerFileRecord);
if (BytesRead != Vcb->NtfsInfo.BytesPerFileRecord)
{
@@ -714,7 +716,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("NtfsLookupFileAt: Can't read MFT record\n");
- ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ ExFreePoolWithTag(*FileRecord, TAG_NTFS);
return Status;
}
@@ -724,7 +726,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("NtfsLookupFileAt: Can't find data attribute\n");
- ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ ExFreePoolWithTag(*FileRecord, TAG_NTFS);
return Status;
}
@@ -775,7 +777,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("NtfsFindFileAt: Can't read MFT record\n");
- ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ ExFreePoolWithTag(*FileRecord, TAG_NTFS);
return Status;
}
@@ -785,7 +787,7 @@
if (!NT_SUCCESS(Status))
{
DPRINT("NtfsFindFileAt: Can't find data attribute\n");
- ExFreePoolWithTag(FileRecord, TAG_NTFS);
+ ExFreePoolWithTag(*FileRecord, TAG_NTFS);
return Status;
}