Janitorial: Remove two fresh redundant NULL checks before HeapFree(). Found by Smatch.

Michael Stefaniuc mstefani at redhat.de
Fri Sep 14 15:34:15 CDT 2007


---
 dlls/shell32/shlfileop.c |    3 +--
 dlls/wined3d/surface.c   |    2 +-
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/dlls/shell32/shlfileop.c b/dlls/shell32/shlfileop.c
index 134d6c5..4f89c4c 100644
--- a/dlls/shell32/shlfileop.c
+++ b/dlls/shell32/shlfileop.c
@@ -1753,8 +1753,7 @@ HRESULT WINAPI SHPathPrepareForWriteW(HWND hwnd, IUnknown *modless, LPCWSTR path
     /* check if we can access the directory */
     res = GetFileAttributesW(realpath);
 
-    if (temppath)
-        HeapFree(GetProcessHeap(), 0, temppath);
+    HeapFree(GetProcessHeap(), 0, temppath);
 
     if (res == INVALID_FILE_ATTRIBUTES)
     {
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index de7beae..ec33e97 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -783,7 +783,7 @@ static HRESULT WINAPI IWineD3DSurfaceImpl_LockRect(IWineD3DSurface *iface, WINED
         checkGLcall("glBindBufferARB");
 
         /* We don't need the system memory anymore and we can't even use it for PBOs */
-        if(This->resource.allocatedMemory) HeapFree(GetProcessHeap(), 0, This->resource.allocatedMemory);
+        HeapFree(GetProcessHeap(), 0, This->resource.allocatedMemory);
         This->resource.allocatedMemory = NULL;
         This->Flags |= SFLAG_PBO;
         LEAVE_GL();
-- 
1.5.3.rc7


-- 
Michael Stefaniuc               Tel.: +49-711-96437-199
Sr. Network Engineer            Fax.: +49-711-96437-111
--------------------------------------------------------------------
Reg. Adresse: Red Hat GmbH, Hauptstätter Strasse 58, 70178 Stuttgart
Handelsregister: Amtsgericht Stuttgart HRB 153243
Geschäftsführer: Brendan Lane, Charlie Peters, Michael Cunningham,
                 Werner Knoblich
-------------- 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/20070914/4cad05d1/attachment.pgp 


More information about the wine-patches mailing list