oleaut32: Check a return value (Coverity).

This commit is contained in:
Marcus Meissner 2013-07-02 15:45:04 +02:00 committed by Alexandre Julliard
parent 653354ab25
commit 0f86ae37c6

View File

@ -1070,15 +1070,16 @@ unsigned char * WINAPI LPSAFEARRAY_UserUnmarshal(ULONG *pFlags, unsigned char *B
Buffer += sizeof(wiresab[0]) * wiresa->cDims; Buffer += sizeof(wiresab[0]) * wiresa->cDims;
if(vt) if(vt)
{
*ppsa = SafeArrayCreateEx(vt, wiresa->cDims, wiresab, NULL); *ppsa = SafeArrayCreateEx(vt, wiresa->cDims, wiresab, NULL);
if (!*ppsa) RpcRaiseException(E_OUTOFMEMORY);
}
else else
{ {
SafeArrayAllocDescriptor(wiresa->cDims, ppsa); if (FAILED(SafeArrayAllocDescriptor(wiresa->cDims, ppsa)))
if(*ppsa) RpcRaiseException(E_OUTOFMEMORY);
memcpy((*ppsa)->rgsabound, wiresab, sizeof(SAFEARRAYBOUND) * wiresa->cDims); memcpy((*ppsa)->rgsabound, wiresab, sizeof(SAFEARRAYBOUND) * wiresa->cDims);
} }
if (!*ppsa)
RpcRaiseException(E_OUTOFMEMORY);
/* be careful about which flags we set since they could be a security /* be careful about which flags we set since they could be a security
* risk */ * risk */