Index: crypt.c =================================================================== --- dll/win32/advapi32/crypt/crypt.c (revision 51637) +++ dll/win32/advapi32/crypt/crypt.c (working copy) @@ -1165,9 +1165,18 @@ return FALSE; } if (RegOpenKeyW(hKey, pszProvName, &subkey)) + { + RegCloseKey(hKey); + SetLastError(NTE_FAIL); return FALSE; + } if (RegQueryValueExW(subkey, typeW, NULL, NULL, (BYTE*)pdwProvType, &size)) + { + RegCloseKey(subkey); + RegCloseKey(hKey); + SetLastError(NTE_FAIL); return FALSE; + } RegCloseKey(subkey); } RegCloseKey(hKey);