Commit b70dd1aa authored by Sebastian Lackner's avatar Sebastian Lackner Committed by Alexandre Julliard

hidclass.sys: Fix memory leak in call_minidriver.

Before 54002103, the output buffer was released because UserIosb != NULL. Signed-off-by: 's avatarSebastian Lackner <sebastian@fds-team.de> Signed-off-by: 's avatarAric Stewart <aric@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 9581f4c1
......@@ -98,18 +98,10 @@ NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG
IRP *irp;
IO_STATUS_BLOCK irp_status;
NTSTATUS status;
void *buffer = NULL;
HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL);
if (out_size)
{
buffer = HeapAlloc(GetProcessHeap(), 0, out_size);
memcpy(buffer, out_buff, out_size);
}
irp = IoBuildDeviceIoControlRequest(code, device, in_buff, in_size,
buffer, out_size, TRUE, NULL, &irp_status);
out_buff, out_size, TRUE, NULL, &irp_status);
IoSetCompletionRoutine(irp, internalComplete, event, TRUE, TRUE, TRUE);
status = IoCallDriver(device, irp);
......@@ -117,7 +109,6 @@ NTSTATUS call_minidriver(ULONG code, DEVICE_OBJECT *device, void *in_buff, ULONG
if (status == STATUS_PENDING)
WaitForSingleObject(event, INFINITE);
memcpy(out_buff, buffer, out_size);
status = irp->IoStatus.u.Status;
IoCompleteRequest(irp, IO_NO_INCREMENT );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment