ntoskrnl.exe: Defer deallocation of in_buff in dispatch_ioctl.

Signed-off-by: Sebastian Lackner <sebastian@fds-team.de>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sebastian Lackner 2016-10-16 08:48:55 +02:00 committed by Alexandre Julliard
parent 48aab01d65
commit 5789b94f19
1 changed files with 3 additions and 1 deletions

View File

@ -417,6 +417,7 @@ static NTSTATUS dispatch_ioctl( const irp_params_t *params, void *in_buff, ULONG
{
IRP *irp;
void *out_buff = NULL;
void *to_free = NULL;
DEVICE_OBJECT *device;
FILE_OBJECT *file = wine_server_get_ptr( params->ioctl.file );
@ -435,7 +436,7 @@ static NTSTATUS dispatch_ioctl( const irp_params_t *params, void *in_buff, ULONG
if ((params->ioctl.code & 3) == METHOD_BUFFERED)
{
memcpy( out_buff, in_buff, in_size );
HeapFree( GetProcessHeap(), 0, in_buff );
to_free = in_buff;
in_buff = out_buff;
}
}
@ -455,6 +456,7 @@ static NTSTATUS dispatch_ioctl( const irp_params_t *params, void *in_buff, ULONG
irp->Flags |= IRP_DEALLOCATE_BUFFER; /* deallocate in_buff */
dispatch_irp( device, irp, irp_handle );
HeapFree( GetProcessHeap(), 0, to_free );
return STATUS_SUCCESS;
}