msvcrt: fix two buglets in heap test

Dan Kegel dank at
Tue Nov 6 18:52:19 CST 2007

The heap test was realloc'ing something and then freeing it
rather than the return value of realloc.
Also, it forgot to free something it realloced (not
terribly important, but heap tests really shouldn't themselves
have any leaks).

Discovered via valgrind warnings:
 Invalid read of size 4
    at 0x4645C2D: _aligned_free (heap.c:336)
    by 0x45FA442: test_aligned_realloc (heap.c:155)
    by 0x45FAB27: func_heap (heap.c:305)
    by 0x4604C3D: run_test (test.h:387)
    by 0x4604E4F: main (test.h:436)
  Address 0x7F00273C is not stack'd, malloc'd or (recently) free'd


 0 bytes in 2 blocks are definitely lost in loss record 1 of 37
    at 0x43F2626: RtlAllocateHeap (heap.c:1225)
    by 0x4645CB6: MSVCRT_malloc (heap.c:281)
    by 0x45FA59F: func_heap (heap.c:341)
    by 0x4604C3D: run_test (test.h:387)
    by 0x4604E4F: main (test.h:436)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: heap-1.patch
Type: text/x-diff
Size: 1314 bytes
Desc: not available
Url : 

More information about the wine-patches mailing list