ole32: Return the buffer pointer when WdtpInterfacePointer_UserMarshal fails
Michael Stefaniuc
mstefani at redhat.de
Mon Jan 19 04:26:14 CST 2015
Found by PVS-Studio
---
dlls/ole32/tests/usrmarshal.c | 1 +
dlls/ole32/usrmarshal.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/ole32/tests/usrmarshal.c b/dlls/ole32/tests/usrmarshal.c
index 8bcec74..086760e 100644
--- a/dlls/ole32/tests/usrmarshal.c
+++ b/dlls/ole32/tests/usrmarshal.c
@@ -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
diff --git a/dlls/ole32/usrmarshal.c b/dlls/ole32/usrmarshal.c
index 9c877b4..6687ac2 100644
--- a/dlls/ole32/usrmarshal.c
+++ b/dlls/ole32/usrmarshal.c
@@ -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);
--
1.9.3
More information about the wine-patches
mailing list