]> granicus.if.org Git - php/commitdiff
shudown crypt correctly and fix memleak in ZTS mode
authorAntony Dovgal <tony2001@php.net>
Tue, 19 Aug 2008 15:14:15 +0000 (15:14 +0000)
committerAntony Dovgal <tony2001@php.net>
Tue, 19 Aug 2008 15:14:15 +0000 (15:14 +0000)
ext/standard/basic_functions.c
ext/standard/crypt.c
ext/standard/php_crypt.h

index a3a0c94c766306d39fc4e5ad986db9912b4e88de..da9ae74e1c9c95089c5812f6ed2629a498ef4d44 100644 (file)
@@ -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;
 }
index 021d749fca31c693e5e369e1a419fbdec0958098..cc7eaf435a69790712e37fef9c8c1d35c588c628 100644 (file)
@@ -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";
index 3e488cfaec8052c05177163d076c3ccc371ef28e..5df233bb93b311a260eb82b5654baafbe518653a 100644 (file)
@@ -26,6 +26,7 @@
 PHP_FUNCTION(crypt);
 #if HAVE_CRYPT
 PHP_MINIT_FUNCTION(crypt);
+PHP_MSHUTDOWN_FUNCTION(crypt);
 PHP_RINIT_FUNCTION(crypt);
 #endif