From 9bb1694aa4fec01bf66fac32f08538f918517dc4 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Tue, 19 Aug 2008 15:14:15 +0000 Subject: [PATCH] shudown crypt correctly and fix memleak in ZTS mode --- ext/standard/basic_functions.c | 2 +- ext/standard/crypt.c | 7 ++++--- ext/standard/php_crypt.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index a3a0c94c76..da9ae74e1c 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -4105,7 +4105,6 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */ basic_globals_dtor(&basic_globals TSRMLS_CC); #ifdef PHP_WIN32 php_win32_core_globals_dtor(&the_php_win32_core_globals TSRMLS_CC); - PHP_MSHUTDOWN(crypt); #endif #endif @@ -4126,6 +4125,7 @@ PHP_MSHUTDOWN_FUNCTION(basic) /* {{{ */ #if defined(HAVE_LOCALECONV) && defined(ZTS) PHP_MSHUTDOWN(localeconv)(SHUTDOWN_FUNC_ARGS_PASSTHRU); #endif + PHP_MSHUTDOWN(crypt)(SHUTDOWN_FUNC_ARGS_PASSTHRU); return SUCCESS; } diff --git a/ext/standard/crypt.c b/ext/standard/crypt.c index 021d749fca..cc7eaf435a 100644 --- a/ext/standard/crypt.c +++ b/ext/standard/crypt.c @@ -108,15 +108,16 @@ PHP_MINIT_FUNCTION(crypt) /* {{{ */ return SUCCESS; } +/* }}} */ -#ifdef PHP_USE_PHP_CRYPT_R -PHP_MSHUTDOWN_FUNCTION(crypt) +PHP_MSHUTDOWN_FUNCTION(crypt) /* {{{ */ { +#ifdef PHP_USE_PHP_CRYPT_R php_shutdown_crypt_r(); +#endif return SUCCESS; } -#endif /* }}} */ static unsigned char itoa64[] = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; diff --git a/ext/standard/php_crypt.h b/ext/standard/php_crypt.h index 3e488cfaec..5df233bb93 100644 --- a/ext/standard/php_crypt.h +++ b/ext/standard/php_crypt.h @@ -26,6 +26,7 @@ PHP_FUNCTION(crypt); #if HAVE_CRYPT PHP_MINIT_FUNCTION(crypt); +PHP_MSHUTDOWN_FUNCTION(crypt); PHP_RINIT_FUNCTION(crypt); #endif -- 2.50.1