Hans Leidekker : msi: Check the return value of MSI_IterateRecords (clang).

Alexandre Julliard julliard at winehq.org
Thu Jul 7 13:33:45 CDT 2011


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Thu Jul  7 09:23:27 2011 +0200

msi: Check the return value of MSI_IterateRecords (clang).

---

 dlls/msi/dialog.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c
index 6159c7b..0ea689d 100644
--- a/dlls/msi/dialog.c
+++ b/dlls/msi/dialog.c
@@ -383,7 +383,6 @@ static UINT msi_dialog_build_font_list( msi_dialog *dialog )
 
     r = MSI_IterateRecords( view, NULL, msi_dialog_add_font, dialog );
     msiobj_release( &view->hdr );
-
     return r;
 }
 
@@ -1495,13 +1494,16 @@ static UINT msi_combobox_add_items( struct msi_combobox_info *info, LPCWSTR prop
     /* just get the number of records */
     count = 0;
     r = MSI_IterateRecords( view, &count, NULL, NULL );
-
+    if (r != ERROR_SUCCESS)
+    {
+        msiobj_release( &view->hdr );
+        return r;
+    }
     info->num_items = count;
     info->items = msi_alloc( sizeof(*info->items) * count );
 
     r = MSI_IterateRecords( view, NULL, msi_combobox_add_item, info );
     msiobj_release( &view->hdr );
-
     return r;
 }
 
@@ -2328,7 +2330,6 @@ static UINT msi_dialog_radiogroup_control( msi_dialog *dialog, MSIRECORD *rec )
     r = MSI_IterateRecords( view, 0, msi_dialog_create_radiobutton, &group );
     msiobj_release( &view->hdr );
     msi_free( group.propval );
-
     return r;
 }
 
@@ -2781,13 +2782,16 @@ static UINT msi_listbox_add_items( struct msi_listbox_info *info, LPCWSTR proper
     /* just get the number of records */
     count = 0;
     r = MSI_IterateRecords( view, &count, NULL, NULL );
-
+    if (r != ERROR_SUCCESS)
+    {
+        msiobj_release( &view->hdr );
+        return r;
+    }
     info->num_items = count;
     info->items = msi_alloc( sizeof(*info->items) * count );
 
     r = MSI_IterateRecords( view, NULL, msi_listbox_add_item, info );
     msiobj_release( &view->hdr );
-
     return r;
 }
 
@@ -3378,7 +3382,6 @@ static UINT msi_dialog_fill_controls( msi_dialog *dialog )
 
     r = MSI_IterateRecords( view, 0, msi_dialog_create_controls, dialog );
     msiobj_release( &view->hdr );
-
     return r;
 }
 




More information about the wine-cvs mailing list