Commit b24ce98a authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

rpcrt4/tests: Avoid a double-free.

Commit 4cf70b14 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.
parent ad9910bd
......@@ -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));
......
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