msxml3: Remove redundant NULL check before HeapFree and fix a mem leak (Smatch).

Michael Stefaniuc mstefani at redhat.de
Thu Jul 31 16:42:02 CDT 2008


---
 dlls/msxml3/saxreader.c |   13 +++++--------
 1 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/dlls/msxml3/saxreader.c b/dlls/msxml3/saxreader.c
index 5a64e2b..2079b2b 100644
--- a/dlls/msxml3/saxreader.c
+++ b/dlls/msxml3/saxreader.c
@@ -468,14 +468,11 @@ static HRESULT SAXAttributes_create(saxattributes **attr,
     if(!attributes->szLocalname || !attributes->szPrefix
             || !attributes->szURI || !attributes->szValue)
     {
-        if(attributes->szLocalname)
-            HeapFree(GetProcessHeap(), 0, attributes->szLocalname);
-        if(attributes->szPrefix)
-            HeapFree(GetProcessHeap(), 0, attributes->szPrefix);
-        if(attributes->szURI)
-            HeapFree(GetProcessHeap(), 0, attributes->szURI);
-        if(attributes->szValue)
-            HeapFree(GetProcessHeap(), 0, attributes->szValue);
+        HeapFree(GetProcessHeap(), 0, attributes->szLocalname);
+        HeapFree(GetProcessHeap(), 0, attributes->szPrefix);
+        HeapFree(GetProcessHeap(), 0, attributes->szURI);
+        HeapFree(GetProcessHeap(), 0, attributes->szValue);
+        HeapFree(GetProcessHeap(), 0, attributes);
         return E_FAIL;
     }
 
-- 
1.6.0.rc1
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20080731/7dde3b78/attachment.pgp 


More information about the wine-patches mailing list