rpcrt4/tests: Avoid a double-free.

Commit 4cf70b1418 was causing the tests to
crash.  The reason is due to a Wine bug in NdrPointerUnmarshall().
Windows returns the same pointer (which is later released in a call to
NdrPointerFree()), while Wine makes a copy which Valgrind correctly
spots is leaked.
This commit is contained in:
Huw Davies 2015-04-20 09:57:29 +01:00 committed by Alexandre Julliard
parent ad9910bdfb
commit b24ce98af3
1 changed files with 5 additions and 1 deletions

View File

@ -1560,6 +1560,11 @@ todo_wine {
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
}
/* Prevent a memory leak when running with Wine.
Remove once the todo_wine block above is fixed. */
if (mem != mem_orig)
HeapFree(GetProcessHeap(), 0, mem_orig);
my_free_called = 0;
StubMsg.Buffer = StubMsg.BufferStart;
NdrPointerFree( &StubMsg, mem, fmtstr_conf_str );
@ -1590,7 +1595,6 @@ todo_wine {
"mem not pointing at buffer %p/%p\n", mem, StubMsg.BufferStart + 12 );
ok(my_alloc_called == 0, "alloc called %d\n", my_alloc_called);
}
HeapFree(GetProcessHeap(), 0, mem_orig);
my_alloc_called = 0;
mem = mem_orig = HeapAlloc(GetProcessHeap(), 0, sizeof(memsrc));