From c6161ac66a7a3edc82915f1d2e4948c772836325 Mon Sep 17 00:00:00 2001 From: David Elliott Date: Tue, 31 Oct 2000 01:36:50 +0000 Subject: [PATCH] _nt_parse_nk() should not close keys that it does not open. --- misc/registry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/misc/registry.c b/misc/registry.c index 8ca97551c47..64e7899265c 100644 --- a/misc/registry.c +++ b/misc/registry.c @@ -746,7 +746,10 @@ static int _nt_parse_nk(HKEY hkey, char * base, nt_nk * nk, int level) if (!_nt_parse_vk(subkey, base, vk)) goto error1; } - RegCloseKey(subkey); + /* Don't close the subkey if it is the hkey that was passed + * (i.e. Level was <= 0) + */ + if( subkey!=hkey ) RegCloseKey(subkey); return TRUE; error1: RegCloseKey(subkey);