From: Richard Levitte Date: Thu, 14 Nov 2002 23:34:07 +0000 (+0000) Subject: Close the implicitely opened registry key. X-Git-Tag: OpenSSL_0_9_7-beta4~32 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d62ec8362ad0438f669a8151472eaf845c810836;p=oweals%2Fopenssl.git Close the implicitely opened registry key. PR: 264 --- diff --git a/crypto/rand/rand_win.c b/crypto/rand/rand_win.c index c1b955b06f..242febe270 100644 --- a/crypto/rand/rand_win.c +++ b/crypto/rand/rand_win.c @@ -287,9 +287,18 @@ int RAND_poll(void) { /* For entropy count assume only least significant * byte of each DWORD is random. - */ + */ RAND_add(&length, sizeof(length), 0); RAND_add(buf, length, length / 4.0); + + /* Close the Registry Key to allow Windows to cleanup/close + * the open handle + * Note: The 'HKEY_PERFORMANCE_DATA' key is implicitly opened + * when the RegQueryValueEx above is done. However, if + * it is not explicitly closed, it can cause disk + * partition manipulation problems. + */ + RegCloseKey(HKEY_PERFORMANCE_DATA); } if (buf) free(buf);