Dan Kegel : advpack: Don't close a handle if it wasn't opened.

Alexandre Julliard julliard at winehq.org
Sat Jun 21 05:38:43 CDT 2008


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

Author: Dan Kegel <dank at kegel.com>
Date:   Fri Jun 20 05:46:24 2008 -0700

advpack: Don't close a handle if it wasn't opened.

---

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

diff --git a/dlls/advpack/advpack.c b/dlls/advpack/advpack.c
index 6c26e51..112d38a 100644
--- a/dlls/advpack/advpack.c
+++ b/dlls/advpack/advpack.c
@@ -70,7 +70,7 @@ static void get_dest_dir(HINF hInf, PCWSTR pszSection, PWSTR pszBuffer, DWORD dw
     INFCONTEXT context;
     WCHAR key[MAX_PATH + 2], value[MAX_PATH + 2];
     WCHAR prefix[PREFIX_LEN + 2];
-    HKEY root, subkey;
+    HKEY root, subkey = 0;
     DWORD size;
 
     static const WCHAR hklm[] = {'H','K','L','M',0};
@@ -102,7 +102,7 @@ static void get_dest_dir(HINF hInf, PCWSTR pszSection, PWSTR pszBuffer, DWORD dw
         strip_quotes(pszBuffer, &size);
     }
 
-    RegCloseKey(subkey);
+    if (subkey) RegCloseKey(subkey);
 }
 
 /* loads the LDIDs specified in the install section of an INF */




More information about the wine-cvs mailing list