[FREELDR]

Fix a bug, when the memory for a file cluster chain record was freed from the heap although it was still in use. Instead free the buffer when the file is closed.

svn path=/trunk/; revision=53982
This commit is contained in:
Timo Kreuzer 2011-10-03 22:59:33 +00:00
parent 7b513395cc
commit 9893e19698

View file

@ -804,8 +804,9 @@ LONG FatLookupFile(PFAT_VOLUME_INFO Volume, PCSTR FileName, ULONG DeviceId, PFAT
return ENOTDIR;
}
DirectoryStartCluster = FatFileInfo.FileFatChain[0];
MmHeapFree(FatFileInfo.FileFatChain);
FatFileInfo.FileFatChain = NULL;
}
MmHeapFree(FatFileInfo.FileFatChain);
}
memcpy(FatFileInfoPointer, &FatFileInfo, sizeof(FAT_FILE_INFO));
@ -1332,6 +1333,7 @@ LONG FatClose(ULONG FileId)
{
PFAT_FILE_INFO FileHandle = FsGetDeviceSpecific(FileId);
if (FileHandle->FileFatChain) MmHeapFree(FileHandle->FileFatChain);
MmHeapFree(FileHandle);
return ESUCCESS;