webservices: Simplify WsAddressMessage.

Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Hans Leidekker 2019-09-25 14:29:56 +02:00 committed by Alexandre Julliard
parent ffd4caa5f0
commit fe9a28e819
1 changed files with 5 additions and 8 deletions

View File

@ -452,16 +452,13 @@ HRESULT WINAPI WsAddressMessage( WS_MESSAGE *handle, const WS_ENDPOINT_ADDRESS *
}
if (msg->state < WS_MESSAGE_STATE_INITIALIZED || msg->is_addressed) hr = WS_E_INVALID_OPERATION;
else
else if (addr && addr->url.length)
{
if (addr && addr->url.length)
if (!(msg->addr.chars = heap_alloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
{
if (!(msg->addr.chars = heap_alloc( addr->url.length * sizeof(WCHAR) ))) hr = E_OUTOFMEMORY;
else
{
memcpy( msg->addr.chars, addr->url.chars, addr->url.length * sizeof(WCHAR) );
msg->addr.length = addr->url.length;
}
memcpy( msg->addr.chars, addr->url.chars, addr->url.length * sizeof(WCHAR) );
msg->addr.length = addr->url.length;
}
}
if (hr == S_OK) msg->is_addressed = TRUE;