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

This commit is contained in:
Dan Kegel 2008-06-20 05:46:24 -07:00 committed by Alexandre Julliard
parent ad0c267f74
commit 64a62d2e8f
1 changed files with 2 additions and 2 deletions

View File

@ -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 */