[MOUNTMGR] QueryPointsFromMemory(): Do not leak DeviceName.Buffer

Follow-up to 7601011f4e.
This commit is contained in:
Serge Gautherie 2019-10-06 01:01:31 +02:00 committed by Pierre Schweitzer
parent 9ad0dd1856
commit 9f8e5d1ce0

View file

@ -344,6 +344,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
{
Irp->IoStatus.Information = sizeof(MOUNTMGR_MOUNT_POINTS);
if (SymbolicName)
{
FreePool(DeviceName.Buffer);
}
return STATUS_BUFFER_OVERFLOW;
}
@ -419,6 +424,11 @@ QueryPointsFromMemory(IN PDEVICE_EXTENSION DeviceExtension,
}
}
if (SymbolicName)
{
FreePool(DeviceName.Buffer);
}
return STATUS_SUCCESS;
}