msi 2: Remove redundant NULL checks before x_Release

James Hawkins truiken at gmail.com
Fri Dec 1 15:31:40 CST 2006


Hi,

Changelog:
* Remove redundant NULL checks before x_Release.

 dlls/msi/action.c   |    6 ++----
 dlls/msi/database.c |    3 +--
 dlls/msi/dialog.c   |    3 +--
 dlls/msi/table.c    |    3 +--
 4 files changed, 5 insertions(+), 10 deletions(-)

-- 
James Hawkins
-------------- next part --------------
diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index cd5bf4b..e15e957 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -3068,10 +3068,8 @@ static UINT ITERATE_CreateShortcuts(MSIR
     msi_free(target_file);    
 
 err:
-    if (pf)
-        IPersistFile_Release( pf );
-    if (sl)
-        IShellLinkW_Release( sl );
+    IPersistFile_Release( pf );
+    IShellLinkW_Release( sl );
 
     return ERROR_SUCCESS;
 }
diff --git a/dlls/msi/database.c b/dlls/msi/database.c
index 8abed5c..cad24d6 100644
--- a/dlls/msi/database.c
+++ b/dlls/msi/database.c
@@ -201,8 +201,7 @@ UINT MSI_OpenDatabaseW(LPCWSTR szDBPath,
 end:
     if( db )
         msiobj_release( &db->hdr );
-    if( stg )
-        IStorage_Release( stg );
+    IStorage_Release( stg );
 
     return ret;
 }
diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index e222dcb..f9bd34c 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -1042,8 +1042,7 @@ static HBITMAP msi_load_picture( MSIDATA
     DeleteDC( destdc );
 
 end:
-    if ( pic )
-        IPicture_Release( pic );
+    IPicture_Release( pic );
     return hBitmap;
 }
 
diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index 014c453..797e005 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -2104,8 +2104,7 @@ UINT msi_table_apply_transform( MSIDATAB
         append_storage_to_db( db, stg );
 
 end:
-    if ( stgenum )
-        IEnumSTATSTG_Release( stgenum );
+    IEnumSTATSTG_Release( stgenum );
     if ( strings )
         msi_destroy_stringtable( strings );
 
-- 
1.4.2.4


More information about the wine-patches mailing list