summaryrefslogtreecommitdiff
path: root/misc/win32/rand.c
diff options
context:
space:
mode:
authorWilliam A. Rowe Jr <wrowe@apache.org>2000-09-20 14:55:54 +0000
committerWilliam A. Rowe Jr <wrowe@apache.org>2000-09-20 14:55:54 +0000
commit8715f2a23f8b30c5f4166a0dc8a556e8d723bb2d (patch)
treeb2aeb47fe951c49e8afcefda50b59ef510a73c64 /misc/win32/rand.c
parent9b1c790f43d9e45b61286e3848d7f472fdc2a9dd (diff)
downloadapr-8715f2a23f8b30c5f4166a0dc8a556e8d723bb2d.tar.gz
Clean up a potential leak.
PR: Obtained from: Submitted by: Reviewed by: git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@60536 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'misc/win32/rand.c')
-rw-r--r--misc/win32/rand.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/misc/win32/rand.c b/misc/win32/rand.c
index 2462b9973..aad32327e 100644
--- a/misc/win32/rand.c
+++ b/misc/win32/rand.c
@@ -64,7 +64,9 @@ apr_status_t apr_generate_random_bytes(unsigned char * buf, int length)
return GetLastError();
}
if (!CryptGenRandom(hProv,length,buf)) {
- return GetLastError();
+ CryptReleaseContext(hProv, 0);
+ return GetLastError();
}
+ CryptReleaseContext(hProv, 0);
return APR_SUCCESS;
}