hid/tests: Do not access uninitialized memory.

Signed-off-by: Detlef Riekenberg <wine.dev@web.de>
Signed-off-by: Aric Stewart <aric@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Detlef Riekenberg 2019-03-21 15:19:48 +01:00 committed by Alexandre Julliard
parent e5bde58411
commit f5f34fe018
1 changed files with 2 additions and 1 deletions

View File

@ -82,7 +82,8 @@ static void run_for_each_device(device_test *test)
ok(file != INVALID_HANDLE_VALUE, "Failed to open %s, error %u.\n",
wine_dbgstr_w(data->DevicePath), GetLastError());
test(file);
if (file != INVALID_HANDLE_VALUE)
test(file);
CloseHandle(file);
}