1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 11:08:02 -06:00

Call RegCloseKey only if handle is valid.

This commit is contained in:
Mounir IDRASSI
2014-09-24 18:31:52 +02:00
parent b80ee2b7b9
commit 411e8599f3

View File

@@ -114,6 +114,7 @@ char *ReadRegistryString (char *subKey, char *name, char *defaultValue, char *st
if (RegQueryValueEx (hkey, name, 0, 0, (LPBYTE) value, &size) == ERROR_SUCCESS)
StringCbCopyA (str, maxLen,value);
if (hkey)
RegCloseKey (hkey);
return str;
}