Michael Stefaniuc : janitorial: Remove two fresh redundant NULL checks before HeapFree(). Found by Smatch.

Alexandre Julliard julliard at winehq.org
Mon Sep 17 08:00:00 CDT 2007


Module: wine
Branch: master
Commit: a5fdea0e6aadc0b292d471c8fbca107c020d887f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a5fdea0e6aadc0b292d471c8fbca107c020d887f

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Fri Sep 14 22:34:15 2007 +0200

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

---

 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 fc0ba4a..7bad3d7 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -796,7 +796,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();




More information about the wine-cvs mailing list