diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-09-24 18:31:52 +0200 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2014-11-08 23:23:34 +0100 |
commit | 411e8599f39a601b26429b3d1183488c413eb21b (patch) | |
tree | eeae22acc48a7f9486b15fbc5e0f183594f0f799 /src/Common/Registry.c | |
parent | b80ee2b7b9e0ff31b651cbc639e74babb58798f3 (diff) | |
download | VeraCrypt-411e8599f39a601b26429b3d1183488c413eb21b.tar.gz VeraCrypt-411e8599f39a601b26429b3d1183488c413eb21b.zip |
Call RegCloseKey only if handle is valid.
Diffstat (limited to 'src/Common/Registry.c')
-rw-r--r-- | src/Common/Registry.c | 3 |
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;
}
|