mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2026-10-10 10:36:35 -05:00
Call RegCloseKey only if handle is valid.
This commit is contained in:
1 parent
b80ee2b7b9
commit
411e8599f3
1 file changed
+2
-1
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user