Alexandre Julliard : ntdll: Avoid reporting a freed block twice to Valgrind .
Module: wine Branch: master Commit: 156d66ec24f93657e3001d5ba4ea2e4cf5ffd248 URL: http://source.winehq.org/git/wine.git/?a=commit;h=156d66ec24f93657e3001d5ba4... Author: Alexandre Julliard <julliard(a)winehq.org> Date: Mon Feb 1 12:35:32 2010 +0100 ntdll: Avoid reporting a freed block twice to Valgrind. --- dlls/ntdll/heap.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c index 5e57fd0..4c73184 100644 --- a/dlls/ntdll/heap.c +++ b/dlls/ntdll/heap.c @@ -281,9 +281,8 @@ static void subheap_notify_free_all(SUBHEAP const *subheap) else { ARENA_INUSE const *pArena = (ARENA_INUSE const *)ptr; - if (pArena->magic != ARENA_INUSE_MAGIC && pArena->magic != ARENA_PENDING_MAGIC) - ERR("bad inuse_magic @%p\n", pArena); - notify_free(pArena + 1); + if (pArena->magic == ARENA_INUSE_MAGIC) notify_free(pArena + 1); + else if (pArena->magic != ARENA_PENDING_MAGIC) ERR("bad inuse_magic @%p\n", pArena); ptr += sizeof(*pArena) + (pArena->size & ARENA_SIZE_MASK); } }
participants (1)
-
Alexandre Julliard