Fix return value for ITERATE_RemoveFiles (in the error case).

Gerald Pfeifer gerald at pfeifer.com
Sat May 1 10:45:56 CDT 2010


We seem to have a track record of incorrect return values (especially
in the error case).  Once again, no point in defining the appropriate
return value only to blindly return success in the end...

Gerald
---
 dlls/msi/files.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/files.c b/dlls/msi/files.c
index 4445773..10dbb28 100644
--- a/dlls/msi/files.c
+++ b/dlls/msi/files.c
@@ -890,7 +890,7 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     UINT install_mode;
     LPWSTR dir = NULL, path = NULL;
     DWORD size;
-    UINT r;
+    UINT ret = ERROR_SUCCESS;
 
     component = MSI_RecordGetString(row, 2);
     filename = MSI_RecordGetString(row, 3);
@@ -920,7 +920,7 @@ static UINT ITERATE_RemoveFiles(MSIRECORD *row, LPVOID param)
     path = msi_alloc(size * sizeof(WCHAR));
     if (!path)
     {
-        r = ERROR_OUTOFMEMORY;
+        ret = ERROR_OUTOFMEMORY;
         goto done;
     }
 
@@ -948,7 +948,7 @@ done:
 
     msi_free(path);
     msi_free(dir);
-    return ERROR_SUCCESS;
+    return ret;
 }
 
 UINT ACTION_RemoveFiles( MSIPACKAGE *package )
-- 
1.6.6.2



More information about the wine-patches mailing list