Alexandre Julliard : ntdll: Free old memory block when reallocating to a large block.

Alexandre Julliard julliard at winehq.org
Mon May 18 08:13:12 CDT 2009


Module: wine
Branch: master
Commit: 13a33b73c349530b17347d3ec6a1f5bb268cc917
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=13a33b73c349530b17347d3ec6a1f5bb268cc917

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat May 16 11:33:06 2009 +0200

ntdll: Free old memory block when reallocating to a large block.

---

 dlls/ntdll/heap.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/ntdll/heap.c b/dlls/ntdll/heap.c
index 4abd35e..2d7d53d 100644
--- a/dlls/ntdll/heap.c
+++ b/dlls/ntdll/heap.c
@@ -1555,7 +1555,8 @@ PVOID WINAPI RtlReAllocateHeap( HANDLE heap, ULONG flags, PVOID ptr, SIZE_T size
             if (!(ret = allocate_large_block( heapPtr, flags, size ))) goto oom;
             notify_alloc( ret, size, flags & HEAP_ZERO_MEMORY );
             memcpy( ret, pArena + 1, oldActualSize );
-            /* FIXME: free old memory here! */
+            notify_free( pArena + 1 );
+            HEAP_MakeInUseBlockFree( subheap, pArena );
             goto done;
         }
         if ((pNext < (char *)subheap->base + subheap->size) &&




More information about the wine-cvs mailing list