mirror of
https://github.com/veracrypt/VeraCrypt
synced 2024-11-30 23:13:31 +01:00
Call RegCloseKey only if handle is valid.
This commit is contained in:
parent
b80ee2b7b9
commit
411e8599f3
@ -114,7 +114,8 @@ char *ReadRegistryString (char *subKey, char *name, char *defaultValue, char *st
|
|||||||
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) value, &size) == ERROR_SUCCESS)
|
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) value, &size) == ERROR_SUCCESS)
|
||||||
StringCbCopyA (str, maxLen,value);
|
StringCbCopyA (str, maxLen,value);
|
||||||
|
|
||||||
RegCloseKey (hkey);
|
if (hkey)
|
||||||
|
RegCloseKey (hkey);
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user