mirror of
https://github.com/reactos/reactos.git
synced 2024-07-08 21:55:08 +00:00
[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:
parent
7b513395cc
commit
9893e19698
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue