From b0ed55d76225b237ffe0dea678f1c2a34677b234 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Poussineau?= Date: Sat, 24 Dec 2005 23:24:40 +0000 Subject: [PATCH] Close the key only if we have opened it (it's not the case when the subkey name is empty) svn path=/trunk/; revision=20324 --- reactos/lib/setupapi/install.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/lib/setupapi/install.c b/reactos/lib/setupapi/install.c index c1f92458e8f..933ff976b13 100644 --- a/reactos/lib/setupapi/install.c +++ b/reactos/lib/setupapi/install.c @@ -433,10 +433,10 @@ static BOOL registry_callback( HINF hinf, PCWSTR field, void *arg ) /* and now do it */ if (!do_reg_operation( hkey, buffer, &context, flags )) { - RegCloseKey( hkey ); + if (hkey != root_key) RegCloseKey( hkey ); return FALSE; } - RegCloseKey( hkey ); + if (hkey != root_key) RegCloseKey( hkey ); } return TRUE; }