mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
No need to allocate too much memory, as SetupDiGetDeviceRegistryPropertyW returns a size in bytes, not in characters. Bug spotted by Filip
svn path=/trunk/; revision=17605
This commit is contained in:
parent
02488d3f49
commit
c1f3b3a122
1 changed files with 2 additions and 2 deletions
|
@ -3466,7 +3466,7 @@ SetupDiBuildDriverInfoList(
|
||||||
while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, HardwareIDs);
|
HeapFree(GetProcessHeap(), 0, HardwareIDs);
|
||||||
HardwareIDs = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR));
|
HardwareIDs = HeapAlloc(GetProcessHeap(), 0, RequiredSize);
|
||||||
if (!HardwareIDs)
|
if (!HardwareIDs)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
@ -3491,7 +3491,7 @@ SetupDiBuildDriverInfoList(
|
||||||
while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
while (!Result && GetLastError() == ERROR_INSUFFICIENT_BUFFER)
|
||||||
{
|
{
|
||||||
HeapFree(GetProcessHeap(), 0, CompatibleIDs);
|
HeapFree(GetProcessHeap(), 0, CompatibleIDs);
|
||||||
CompatibleIDs = HeapAlloc(GetProcessHeap(), 0, RequiredSize * sizeof(WCHAR));
|
CompatibleIDs = HeapAlloc(GetProcessHeap(), 0, RequiredSize);
|
||||||
if (!CompatibleIDs)
|
if (!CompatibleIDs)
|
||||||
{
|
{
|
||||||
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
SetLastError(ERROR_NOT_ENOUGH_MEMORY);
|
||||||
|
|
Loading…
Reference in a new issue