hidclass: Fix handle leak on error path (Coverity).

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2016-08-23 00:05:36 +03:00 committed by Alexandre Julliard
parent 94845c400e
commit 026353bf7b
1 changed files with 2 additions and 2 deletions

View File

@ -47,14 +47,14 @@ static NTSTATUS get_device_id(DEVICE_OBJECT *device, BUS_QUERY_ID_TYPE type, WCH
NTSTATUS status;
IO_STACK_LOCATION *irpsp;
IO_STATUS_BLOCK irp_status;
HANDLE event;
IRP *irp;
HANDLE event = CreateEventA(NULL, FALSE, FALSE, NULL);
irp = IoBuildSynchronousFsdRequest(IRP_MJ_PNP, device, NULL, 0, NULL, NULL, &irp_status);
if (irp == NULL)
return STATUS_NO_MEMORY;
irp->UserEvent = event;
irp->UserEvent = event = CreateEventA(NULL, FALSE, FALSE, NULL);
irpsp = IoGetNextIrpStackLocation(irp);
irpsp->MinorFunction = IRP_MN_QUERY_ID;
irpsp->Parameters.QueryId.IdType = type;