From e4c8e1dc853ab9288dac5fd076e8676bcd491f3f Mon Sep 17 00:00:00 2001 From: foobar Date: Sun, 6 Nov 2005 22:41:51 +0000 Subject: [PATCH] - Fixed minor memory leak triggered by: -dzlib.output_compression=1 -m --- sapi/cli/php_cli.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index f37b12f335..e4ba746104 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -719,8 +719,9 @@ int main(int argc, char *argv[]) goto out; case 'm': /* list compiled in modules */ - php_output_startup(); - php_output_activate(TSRMLS_C); + if (php_request_startup(TSRMLS_C)==FAILURE) { + goto err; + } php_printf("[PHP Modules]\n"); print_modules(TSRMLS_C); php_printf("\n[Zend Modules]\n"); @@ -728,19 +729,24 @@ int main(int argc, char *argv[]) php_printf("\n"); php_end_ob_buffers(1 TSRMLS_CC); exit_status=0; - sapi_deactivate(TSRMLS_C); - zend_ini_deactivate(TSRMLS_C); - goto out_err; + goto out; case 'v': /* show php version & quit */ - if (php_request_startup(TSRMLS_C)==FAILURE) { + if (php_request_startup(TSRMLS_C) == FAILURE) { goto err; } -#if ZEND_DEBUG - php_printf("PHP %s (%s) (built: %s %s) (DEBUG)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); -#else - php_printf("PHP %s (%s) (built: %s %s)\nCopyright (c) 1997-2005 The PHP Group\n%s", PHP_VERSION, sapi_module.name, __DATE__, __TIME__, get_zend_version()); + + php_printf("PHP %s (%s) (built: %s %s) %s\nCopyright (c) 1997-2005 The PHP Group\n%s", + PHP_VERSION, sapi_module.name, __DATE__, __TIME__, +#if ZEND_DEBUG && defined(HAVE_GCOV) + "(DEBUG GCOV)", +#elif ZEND_DEBUG + "(DEBUG)", +#elif defined(HAVE_GCOV) + "(GCOV)", #endif + get_zend_version() + ); php_end_ob_buffers(1 TSRMLS_CC); exit_status=0; goto out; -- 2.50.1