mirror of
https://github.com/reactos/reactos.git
synced 2024-09-10 04:42:00 +00:00
[KERNEL32]
- Don't access freed memory in GetVolumeNameForVolumeMountPointW svn path=/trunk/; revision=44141
This commit is contained in:
parent
165c423eed
commit
5a56a7c2da
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue