summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntony Dovgal <tony2001@php.net>2008-08-19 15:14:46 +0000
committerAntony Dovgal <tony2001@php.net>2008-08-19 15:14:46 +0000
commit881d80382bf4821b1696cc7d464fce4a6a946ba9 (patch)
treed3f090e5c88caecd3a78e02397027b23190c7b67
parent5293e7981e885564421d9061bc991c1e092922a4 (diff)
downloadphp-git-881d80382bf4821b1696cc7d464fce4a6a946ba9.tar.gz
MFH: shutdown crypt correctly and fix memleak in ZTS mode
-rw-r--r--ext/standard/basic_functions.c2
-rw-r--r--ext/standard/crypt.c7
-rw-r--r--ext/standard/php_crypt.h2
3 files changed, 5 insertions, 6 deletions
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index b103b2a281..0cb94c2dfc 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -4108,7 +4108,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
@@ -4129,6 +4128,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 5eca38855d..141b63b5b5 100644
--- a/ext/standard/crypt.c
+++ b/ext/standard/crypt.c
@@ -107,15 +107,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 4e5a874e8a..5df233bb93 100644
--- a/ext/standard/php_crypt.h
+++ b/ext/standard/php_crypt.h
@@ -26,9 +26,7 @@
PHP_FUNCTION(crypt);
#if HAVE_CRYPT
PHP_MINIT_FUNCTION(crypt);
-#if PHP_WIN32
PHP_MSHUTDOWN_FUNCTION(crypt);
-#endif
PHP_RINIT_FUNCTION(crypt);
#endif