[PATCH] hidclass: Fix handle leak on error path (Coverity)

Aric Stewart aric at codeweavers.com
Tue Aug 23 12:59:19 CDT 2016


Signed-off-by: Aric Stewart <aric at codeweavers.com>

On 8/22/16 4:05 PM, Nikolay Sivov wrote:
> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
> ---
>  dlls/hidclass.sys/pnp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/dlls/hidclass.sys/pnp.c b/dlls/hidclass.sys/pnp.c
> index 8fd5c17..421737d 100644
> --- a/dlls/hidclass.sys/pnp.c
> +++ b/dlls/hidclass.sys/pnp.c
> @@ -58,14 +58,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;
> 



More information about the wine-patches mailing list