[PATCH] msi: move free after last usage (Coverity)

Marcus Meissner meissner at suse.de
Thu Sep 6 08:19:48 CDT 2012


CID714083

forgot to remove the old msi_free on first try.

Ciao, Marcus
---
 dlls/msi/table.c |    6 ++++--
 1 Datei geändert, 4 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)

diff --git a/dlls/msi/table.c b/dlls/msi/table.c
index dd25fbb..6f5f5e7 100644
--- a/dlls/msi/table.c
+++ b/dlls/msi/table.c
@@ -2328,12 +2328,14 @@ static MSIRECORD *msi_get_transform_record( const MSITABLEVIEW *tv, const string
 
             r = IStorage_OpenStream( stg, encname, NULL,
                      STGM_READ | STGM_SHARE_EXCLUSIVE, 0, &stm );
-            msi_free( encname );
-            if ( r != ERROR_SUCCESS )
+            if ( r != ERROR_SUCCESS ) {
+                msi_free( encname );
                 return NULL;
+            }
 
             MSI_RecordSetStream( rec, i+1, stm );
             TRACE(" field %d [%s]\n", i+1, debugstr_w(encname));
+            msi_free( encname );
         }
         else if( columns[i].type & MSITYPE_STRING )
         {
-- 
1.7.10.4




More information about the wine-patches mailing list