oleaut32: Don't call SafeArrayAllocData in LPSAFEARRAY_UserUnmarshal if we called SafeArrayCreateEx instead of SafeArrayAllocDescriptor.
Otherwise, we'll leak memory.
This commit is contained in:
parent
2ebee18198
commit
baccba317e
@ -1048,9 +1048,14 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
|
|||||||
(*ppsa)->cbElements = wiresa->cbElements;
|
(*ppsa)->cbElements = wiresa->cbElements;
|
||||||
(*ppsa)->cLocks = LOWORD(wiresa->cLocks);
|
(*ppsa)->cLocks = LOWORD(wiresa->cLocks);
|
||||||
|
|
||||||
hr = SafeArrayAllocData(*ppsa);
|
/* SafeArrayCreateEx allocates the data for us, but
|
||||||
if (FAILED(hr))
|
* SafeArrayAllocDescriptor doesn't */
|
||||||
RpcRaiseException(hr);
|
if(!vt)
|
||||||
|
{
|
||||||
|
hr = SafeArrayAllocData(*ppsa);
|
||||||
|
if (FAILED(hr))
|
||||||
|
RpcRaiseException(hr);
|
||||||
|
}
|
||||||
|
|
||||||
if ((*(ULONG *)Buffer != cell_count) || (SAFEARRAY_GetCellCount(*ppsa) != cell_count))
|
if ((*(ULONG *)Buffer != cell_count) || (SAFEARRAY_GetCellCount(*ppsa) != cell_count))
|
||||||
RpcRaiseException(RPC_S_INVALID_BOUND);
|
RpcRaiseException(RPC_S_INVALID_BOUND);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user