mirror of
https://github.com/reactos/reactos.git
synced 2024-10-06 17:35:07 +00:00
Swap arguments of LocalAlloc and only update Malloc32 block on successful
allocation. Fixes bug #154. svn path=/trunk/; revision=7707
This commit is contained in:
parent
c60de92aba
commit
fa2b0ba8e3
|
@ -73,10 +73,16 @@ static CRITICAL_SECTION IMalloc32_SpyCS = { &critsect_debug, -1, 0, 0, 0, 0 };
|
||||||
/* resize the old table */
|
/* resize the old table */
|
||||||
static int SetSpyedBlockTableLength ( int NewLength )
|
static int SetSpyedBlockTableLength ( int NewLength )
|
||||||
{
|
{
|
||||||
if (!Malloc32.SpyedBlocks) Malloc32.SpyedBlocks = (LPVOID*)LocalAlloc(NewLength, GMEM_ZEROINIT);
|
LPVOID *NewSpyedBlocks;
|
||||||
else Malloc32.SpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
|
|
||||||
|
if (!Malloc32.SpyedBlocks) NewSpyedBlocks = (LPVOID*)LocalAlloc(GMEM_ZEROINIT, NewLength);
|
||||||
|
else NewSpyedBlocks = (LPVOID*)LocalReAlloc((HLOCAL)Malloc32.SpyedBlocks, NewLength, GMEM_ZEROINIT);
|
||||||
|
if (NewSpyedBlocks) {
|
||||||
|
Malloc32.SpyedBlocks = NewSpyedBlocks;
|
||||||
Malloc32.SpyedBlockTableLength = NewLength;
|
Malloc32.SpyedBlockTableLength = NewLength;
|
||||||
return Malloc32.SpyedBlocks ? 1 : 0;
|
}
|
||||||
|
|
||||||
|
return NewSpyedBlocks ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* add a location to the table */
|
/* add a location to the table */
|
||||||
|
|
Loading…
Reference in a new issue