VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
authorMounir IDRASSI <mounir.idrassi@idrix.fr>2014-09-24 18:31:52 +0200
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2014-11-08 23:23:34 +0100
commit411e8599f39a601b26429b3d1183488c413eb21b (patch)
treeeeae22acc48a7f9486b15fbc5e0f183594f0f799 /src/Common
parentb80ee2b7b9e0ff31b651cbc639e74babb58798f3 (diff)
downloadVeraCrypt-411e8599f39a601b26429b3d1183488c413eb21b.tar.gz
VeraCrypt-411e8599f39a601b26429b3d1183488c413eb21b.zip
Call RegCloseKey only if handle is valid.
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Registry.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Common/Registry.c b/src/Common/Registry.c
index a68e5f18..0b17dc51 100644
--- a/src/Common/Registry.c
+++ b/src/Common/Registry.c
@@ -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)
StringCbCopyA (str, maxLen,value);
- RegCloseKey (hkey);
+ if (hkey)
+ RegCloseKey (hkey);
return str;
}