[PATCH 1/3] webservices: Simplify WsAddressMessage.

Hans Leidekker hans at codeweavers.com
Wed Sep 25 07:29:56 CDT 2019


Signed-off-by: Hans Leidekker <hans at codeweavers.com>
---
 dlls/webservices/msg.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c
index ed9394ef22..d6906cb5de 100644
--- a/dlls/webservices/msg.c
+++ b/dlls/webservices/msg.c
@@ -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;
-- 
2.20.1




More information about the wine-devel mailing list