setupapi: Only copy driver info if SetupDiEnumDriverInfoW succeeded (Valgrind).

Signed-off-by: Sven Baars <sbaars@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Sven Baars 2020-04-17 20:20:11 +02:00 committed by Alexandre Julliard
parent c85b140531
commit b08974900f
1 changed files with 2 additions and 1 deletions

View File

@ -4716,7 +4716,8 @@ BOOL WINAPI SetupDiEnumDriverInfoA(HDEVINFO devinfo, SP_DEVINFO_DATA *device_dat
driver_dataW.cbSize = sizeof(driver_dataW);
ret = SetupDiEnumDriverInfoW(devinfo, device_data, type, index, &driver_dataW);
driver_data_wtoa(driver_data, &driver_dataW);
if (ret) driver_data_wtoa(driver_data, &driver_dataW);
return ret;
}