[KERNEL32]

- Don't access freed memory in GetVolumeNameForVolumeMountPointW

svn path=/trunk/; revision=44141
This commit is contained in:
Johannes Anderwald 2009-11-13 17:31:02 +00:00
parent 165c423eed
commit 5a56a7c2da

View file

@ -996,15 +996,16 @@ GetVolumeNameForVolumeMountPointW(
MountPoints, BufferLength); MountPoints, BufferLength);
if (!NT_SUCCESS(Status)) if (!NT_SUCCESS(Status))
{ {
RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints);
if (Status == STATUS_BUFFER_OVERFLOW) if (Status == STATUS_BUFFER_OVERFLOW)
{ {
BufferLength = MountPoints->Size; BufferLength = MountPoints->Size;
RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints);
continue; continue;
} }
else if (!NT_SUCCESS(Status)) else if (!NT_SUCCESS(Status))
{ {
RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint); RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoint);
RtlFreeHeap(RtlGetProcessHeap(), 0, MountPoints);
NtClose(FileHandle); NtClose(FileHandle);
SetLastErrorByStatus(Status); SetLastErrorByStatus(Status);
return FALSE; return FALSE;