[PATCH] webservices: free header on error exit (Coverity)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[PATCH] webservices: free header on error exit (Coverity)

Marcus Meissner-4
CID 1412744 Resource leak

Signed-off-by: Marcus Meissner <[hidden email]>
---
 dlls/webservices/msg.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/webservices/msg.c b/dlls/webservices/msg.c
index 74c6fd1e68..f27aceac5f 100644
--- a/dlls/webservices/msg.c
+++ b/dlls/webservices/msg.c
@@ -1008,7 +1008,7 @@ static HRESULT build_standard_header( struct msg *msg, WS_HEADER_TYPE type, WS_T
 
     if (!(header = alloc_header( type, FALSE, get_header_name(type), NULL ))) return E_OUTOFMEMORY;
 
-    if (!msg->writer && (hr = WsCreateWriter( NULL, 0, &msg->writer, NULL )) != S_OK) return hr;
+    if (!msg->writer && (hr = WsCreateWriter( NULL, 0, &msg->writer, NULL )) != S_OK) goto done;
     if ((hr = WsCreateXmlBuffer( msg->heap, NULL, 0, &buf, NULL )) != S_OK) goto done;
     if ((hr = WsSetOutputToBuffer( msg->writer, buf, NULL, 0, NULL )) != S_OK) goto done;
     if ((hr = write_standard_header( msg, type, value_type, option, value, size )) != S_OK) goto done;
--
2.13.1



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [PATCH] webservices: free header on error exit (Coverity)

Hans Leidekker-4
Signed-off-by: Hans Leidekker <[hidden email]>




Loading...