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)->cLocks = LOWORD(wiresa->cLocks);
|
||||
|
||||
hr = SafeArrayAllocData(*ppsa);
|
||||
if (FAILED(hr))
|
||||
RpcRaiseException(hr);
|
||||
/* SafeArrayCreateEx allocates the data for us, but
|
||||
* SafeArrayAllocDescriptor doesn't */
|
||||
if(!vt)
|
||||
{
|
||||
hr = SafeArrayAllocData(*ppsa);
|
||||
if (FAILED(hr))
|
||||
RpcRaiseException(hr);
|
||||
}
|
||||
|
||||
if ((*(ULONG *)Buffer != cell_count) || (SAFEARRAY_GetCellCount(*ppsa) != cell_count))
|
||||
RpcRaiseException(RPC_S_INVALID_BOUND);
|
||||
|
|
Loading…
Reference in New Issue