Skip to content
Browse files

- fix #60895, possible invalid handler usage

  • Loading branch information...
1 parent 9fa30bf commit 1e462057cdcb82c57c18dbb45ca21893def6ac56 @pierrejoye pierrejoye committed
Showing with 4 additions and 2 deletions.
  1. +4 −2 win32/winutil.c
View
6 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);

0 comments on commit 1e46205

Please sign in to comment.
Something went wrong with that request. Please try again.