Commit 2e5a48be authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

kernel: Fix clearing of memory in LocalReAlloc16(..., LMEM_ZEROMEMORY).

parent cfbd3384
......@@ -1331,7 +1331,12 @@ HLOCAL16 WINAPI LocalReAlloc16( HLOCAL16 handle, WORD size, UINT16 flags )
TRACE("size increase, making new free block\n");
LOCAL_GrowArenaUpward(ds, arena, nextarena - arena);
if (flags & LMEM_ZEROINIT)
memset((char *)pArena + oldsize, 0, size - oldsize);
{
char *oldend = (char *)pArena + ARENA_HEADER_SIZE + oldsize;
char *newend = ptr + pArena->next;
TRACE("Clearing memory from %p to %p (DS -> %p)\n", oldend, newend, ptr);
memset(oldend, 0, newend - oldend);
}
TRACE("returning %04x\n", handle );
return handle;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment