From: Mark Andrews Date: Mon, 18 Jun 2007 03:05:46 +0000 (+0000) Subject: 2198. [bug] win32: RegCloseKey() could be called when X-Git-Tag: v9.5.0a6~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=32391301db6f532ad17033f188d4540ae3f409f1;p=thirdparty%2Fbind9.git 2198. [bug] win32: RegCloseKey() could be called when RegOpenKeyEx() failed. [RT #16911] --- diff --git a/CHANGES b/CHANGES index 47afab5d597..04d9a75b9c3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +2198. [bug] win32: RegCloseKey() could be called when + RegOpenKeyEx() failed. [RT #16911] + 2197. [bug] Add INSIST to catch negative responses which are not setting the event result code appropriately. [RT #16909] diff --git a/lib/isc/win32/ntpaths.c b/lib/isc/win32/ntpaths.c index 7043c000dfb..b72c0d5116e 100644 --- a/lib/isc/win32/ntpaths.c +++ b/lib/isc/win32/ntpaths.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: ntpaths.c,v 1.9 2004/03/05 05:11:58 marka Exp $ */ +/* $Id: ntpaths.c,v 1.10 2007/06/18 03:05:46 marka Exp $ */ /* * This module fetches the required path information that is specific @@ -63,9 +63,8 @@ isc_ntpaths_init() { if (RegQueryValueEx(hKey, "InstallDir", NULL, NULL, (LPBYTE)namedBase, &baseLen) != ERROR_SUCCESS) keyFound = FALSE; + RegCloseKey(hKey); } - - RegCloseKey(hKey); GetSystemDirectory(systemDir, MAX_PATH); diff --git a/lib/lwres/win32/lwconfig.c b/lib/lwres/win32/lwconfig.c index 8645e9cd8ab..e5995e76986 100644 --- a/lib/lwres/win32/lwconfig.c +++ b/lib/lwres/win32/lwconfig.c @@ -15,7 +15,7 @@ * PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: lwconfig.c,v 1.4 2006/10/03 23:50:52 marka Exp $ */ +/* $Id: lwconfig.c,v 1.5 2007/06/18 03:05:46 marka Exp $ */ /* * We do this so that we may incorporate everything in the main routines @@ -67,10 +67,9 @@ get_win32_searchlist(lwres_context_t *ctx) { if (RegQueryValueEx(hKey, "SearchList", NULL, NULL, (LPBYTE)searchlist, &searchlen) != ERROR_SUCCESS) keyFound = FALSE; + RegCloseKey(hKey); } - RegCloseKey(hKey); - confdata->searchnxt = 0; idx = 0;