msxml3: Correctly handle VT_NULL in IXMLHTTPRequest::send.

This commit is contained in:
Jacek Caban 2013-05-10 14:21:41 +02:00 committed by Alexandre Julliard
parent fdc4d40d18
commit 2dd4e497d6
1 changed files with 16 additions and 12 deletions

View File

@ -736,27 +736,31 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
/* fall through */
case VT_EMPTY:
case VT_ERROR:
case VT_NULL:
ptr = NULL;
size = 0;
break;
}
bsc->body = GlobalAlloc(GMEM_FIXED, size);
if (!bsc->body)
if (size)
{
if (V_VT(body) == VT_BSTR)
heap_free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))
SafeArrayUnaccessData(sa);
bsc->body = GlobalAlloc(GMEM_FIXED, size);
if (!bsc->body)
{
if (V_VT(body) == VT_BSTR)
heap_free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))
SafeArrayUnaccessData(sa);
heap_free(bsc);
return E_OUTOFMEMORY;
heap_free(bsc);
return E_OUTOFMEMORY;
}
send_data = GlobalLock(bsc->body);
memcpy(send_data, ptr, size);
GlobalUnlock(bsc->body);
}
send_data = GlobalLock(bsc->body);
memcpy(send_data, ptr, size);
GlobalUnlock(bsc->body);
if (V_VT(body) == VT_BSTR)
heap_free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))