Andrew Talbot : msi: Fix use of uninitialized variable (Coverity).

Alexandre Julliard julliard at wine.codeweavers.com
Mon Jun 25 07:28:30 CDT 2007


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

Author: Andrew Talbot <Andrew.Talbot at talbotville.com>
Date:   Sat Jun 23 17:28:50 2007 +0100

msi: Fix use of uninitialized variable (Coverity).

---

 dlls/msi/action.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/msi/action.c b/dlls/msi/action.c
index ab3c914..820d91d 100644
--- a/dlls/msi/action.c
+++ b/dlls/msi/action.c
@@ -4648,7 +4648,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
     LPWSTR deformatted, ptr;
     DWORD flags, type, size;
     LONG res;
-    HKEY env, root = HKEY_CURRENT_USER;
+    HKEY env = NULL, root = HKEY_CURRENT_USER;
 
     static const WCHAR environment[] =
         {'S','y','s','t','e','m','\\',
@@ -4759,7 +4759,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
     res = RegSetValueExW(env, name, 0, type, (LPVOID)newval, size);
 
 done:
-    RegCloseKey(env);
+    if (env) RegCloseKey(env);
     msi_free(deformatted);
     msi_free(data);
     msi_free(newval);




More information about the wine-cvs mailing list