summaryrefslogtreecommitdiff
path: root/win32
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2012-01-27 10:56:33 +0000
committerPierre Joye <pajoye@php.net>2012-01-27 10:56:33 +0000
commit4879a01b54ef49b98f3cb0dee6d0553099230acf (patch)
treee92e5e27e8a30eba28edd35231687fbf40f1f7db /win32
parentd997e578b7c6df8ba39e3dac749b249ddc983fde (diff)
downloadphp-git-4879a01b54ef49b98f3cb0dee6d0553099230acf.tar.gz
- fix #60895, possible invalid handler usage
Diffstat (limited to 'win32')
-rw-r--r--win32/winutil.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/win32/winutil.c b/win32/winutil.c
index c3e668b710..878e95ca89 100644
--- a/win32/winutil.c
+++ b/win32/winutil.c
@@ -62,8 +62,10 @@ void php_win32_init_rng_lock()
void php_win32_free_rng_lock()
{
tsrm_mutex_lock(php_lock_win32_cryptoctx);
- CryptReleaseContext(hCryptProv, 0);
- has_crypto_ctx = 0;
+ if (has_crypto_ctx == 1) {
+ CryptReleaseContext(hCryptProv, 0);
+ has_crypto_ctx = 0;
+ }
tsrm_mutex_unlock(php_lock_win32_cryptoctx);
tsrm_mutex_free(php_lock_win32_cryptoctx);