ole32: Return the buffer pointer when WdtpInterfacePointer_UserMarshal fails.

Found by PVS-Studio.
This commit is contained in:
Michael Stefaniuc 2015-01-19 11:26:14 +01:00 committed by Alexandre Julliard
parent 139ebf643a
commit 514951cc11
2 changed files with 2 additions and 1 deletions

View File

@ -576,6 +576,7 @@ static void marshal_WdtpInterfacePointer(DWORD umcb_ctx, DWORD ctx)
ok(size == 0, "size should be 0 bytes, not %d\n", size);
buffer = HeapAlloc(GetProcessHeap(), 0, size);
buffer_end = WdtpInterfacePointer_UserMarshal(&umcb.Flags, ctx, buffer, unk, &IID_IUnknown);
ok(buffer_end == buffer, "buffer_end %p buffer %p\n", buffer_end, buffer);
HeapFree(GetProcessHeap(), 0, buffer);
/* Now for a non-NULL pointer. The marshalled data are two size DWORDS and then

View File

@ -1641,7 +1641,7 @@ unsigned char * WINAPI WdtpInterfacePointer_UserMarshal(ULONG *pFlags, ULONG Rea
if(CoMarshalInterface(stm, riid, punk, LOWORD(RealFlags), NULL, MSHLFLAGS_NORMAL) != S_OK)
{
IStream_Release(stm);
return NULL;
return pBuffer;
}
ALIGN_POINTER(pBuffer, 3);