- fix #60895, possible invalid handler usage

This commit is contained in:
Pierre Joye 2012-01-27 10:56:33 +00:00
parent d997e578b7
commit 4879a01b54
2 changed files with 17 additions and 13 deletions

2
NEWS
View file

@ -7,6 +7,8 @@ PHP NEWS
(rui) (rui)
. Fixed bug #60825 (Segfault when running symfony 2 tests). . Fixed bug #60825 (Segfault when running symfony 2 tests).
(Dmitry, Laruence) (Dmitry, Laruence)
. Fix bug #60895 (Possible invalid handler usage in windows random
functions). (Pierre)
- Firebird Database extension (ibase): - Firebird Database extension (ibase):
. Fixed bug #60802 (ibase_trans() gives segfault when passing params). . Fixed bug #60802 (ibase_trans() gives segfault when passing params).

View file

@ -62,8 +62,10 @@ void php_win32_init_rng_lock()
void php_win32_free_rng_lock() void php_win32_free_rng_lock()
{ {
tsrm_mutex_lock(php_lock_win32_cryptoctx); tsrm_mutex_lock(php_lock_win32_cryptoctx);
if (has_crypto_ctx == 1) {
CryptReleaseContext(hCryptProv, 0); CryptReleaseContext(hCryptProv, 0);
has_crypto_ctx = 0; has_crypto_ctx = 0;
}
tsrm_mutex_unlock(php_lock_win32_cryptoctx); tsrm_mutex_unlock(php_lock_win32_cryptoctx);
tsrm_mutex_free(php_lock_win32_cryptoctx); tsrm_mutex_free(php_lock_win32_cryptoctx);