ole32: If number of VT_VECTOR elements is 0 there is no need to allocate memory.
This commit is contained in:
parent
d68c13a894
commit
f9c40c37cd
|
@ -3143,7 +3143,7 @@ HRESULT WINAPI PropVariantCopy(PROPVARIANT *pvarDest, /* [out] */
|
|||
return E_INVALIDARG;
|
||||
}
|
||||
len = pvarSrc->u.capropvar.cElems;
|
||||
pvarDest->u.capropvar.pElems = CoTaskMemAlloc(len * elemSize);
|
||||
pvarDest->u.capropvar.pElems = len ? CoTaskMemAlloc(len * elemSize) : NULL;
|
||||
if (pvarSrc->vt == (VT_VECTOR | VT_VARIANT))
|
||||
{
|
||||
for (i = 0; i < len; i++)
|
||||
|
|
|
@ -263,7 +263,6 @@ static void test_validtypes(void)
|
|||
{
|
||||
ok(copy.vt == propvar.vt, "expected %d, got %d\n", propvar.vt, copy.vt);
|
||||
ok(!U(copy).caub.cElems, "%u: expected 0, got %d\n", i, U(copy).caub.cElems);
|
||||
todo_wine
|
||||
ok(!U(copy).caub.pElems, "%u: expected NULL, got %p\n", i, U(copy).caub.pElems);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue