From f5f34fe018f2d2d0c0663027bddb4a073f5308d9 Mon Sep 17 00:00:00 2001 From: Detlef Riekenberg Date: Thu, 21 Mar 2019 15:19:48 +0100 Subject: [PATCH] hid/tests: Do not access uninitialized memory. Signed-off-by: Detlef Riekenberg Signed-off-by: Aric Stewart Signed-off-by: Alexandre Julliard --- dlls/hid/tests/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/hid/tests/device.c b/dlls/hid/tests/device.c index f20677fb1b4..ff17229785c 100644 --- a/dlls/hid/tests/device.c +++ b/dlls/hid/tests/device.c @@ -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); }