Commit 2dd4e497 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

msxml3: Correctly handle VT_NULL in IXMLHTTPRequest::send.

parent fdc4d40d
...@@ -736,26 +736,30 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback * ...@@ -736,26 +736,30 @@ static HRESULT BindStatusCallback_create(httprequest* This, BindStatusCallback *
/* fall through */ /* fall through */
case VT_EMPTY: case VT_EMPTY:
case VT_ERROR: case VT_ERROR:
case VT_NULL:
ptr = NULL; ptr = NULL;
size = 0; size = 0;
break; break;
} }
bsc->body = GlobalAlloc(GMEM_FIXED, size); if (size)
if (!bsc->body)
{ {
if (V_VT(body) == VT_BSTR) bsc->body = GlobalAlloc(GMEM_FIXED, size);
heap_free(ptr); if (!bsc->body)
else if (V_VT(body) == (VT_ARRAY|VT_UI1)) {
SafeArrayUnaccessData(sa); if (V_VT(body) == VT_BSTR)
heap_free(ptr);
else if (V_VT(body) == (VT_ARRAY|VT_UI1))
SafeArrayUnaccessData(sa);
heap_free(bsc); heap_free(bsc);
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
} }
send_data = GlobalLock(bsc->body); send_data = GlobalLock(bsc->body);
memcpy(send_data, ptr, size); memcpy(send_data, ptr, size);
GlobalUnlock(bsc->body); GlobalUnlock(bsc->body);
}
if (V_VT(body) == VT_BSTR) if (V_VT(body) == VT_BSTR)
heap_free(ptr); heap_free(ptr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment