summaryrefslogtreecommitdiff
path: root/crypto/rand/rand_win.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2002-11-14 23:33:28 +0000
committerRichard Levitte <levitte@openssl.org>2002-11-14 23:33:28 +0000
commit35a6db86402290a6cbe05fc615e0c435eac40aea (patch)
tree23dfabbd0430acef524848c9c75fe45ed8e18a03 /crypto/rand/rand_win.c
parent56dc24d48315285ba3c0395d315282275217e597 (diff)
downloadopenssl-new-35a6db86402290a6cbe05fc615e0c435eac40aea.tar.gz
Close the implicitely opened registry key.
PR: 264
Diffstat (limited to 'crypto/rand/rand_win.c')
-rw-r--r--crypto/rand/rand_win.c11
1 files changed, 10 insertions, 1 deletions
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);