diff options
author | Felipe Pena <felipe@php.net> | 2011-06-25 14:17:17 +0000 |
---|---|---|
committer | Felipe Pena <felipe@php.net> | 2011-06-25 14:17:17 +0000 |
commit | 29588a6fa356dec9b76108e3bcc5a30483308c84 (patch) | |
tree | a00ba9ec3fc7a3cb9a8100c548962b14e34ad3e1 /sapi/cli/php_cli.c | |
parent | dc467a70d302cd2554a647cacef7f4145b4910ba (diff) | |
download | php-git-29588a6fa356dec9b76108e3bcc5a30483308c84.tar.gz |
- Fixed crash when calling sapi_shutdown() and sapi hasn't been started
Reported by: David Tajchreber
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r-- | sapi/cli/php_cli.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c index cdce836445..14ac439a86 100644 --- a/sapi/cli/php_cli.c +++ b/sapi/cli/php_cli.c @@ -1194,7 +1194,7 @@ int main(int argc, char *argv[]) #endif int c; int exit_status = SUCCESS; - int module_started = 0; + int module_started = 0, sapi_started = 0; char *php_optarg = NULL; int php_optind = 1; char *ini_path_override = NULL; @@ -1312,6 +1312,7 @@ exit_loop: sapi_module->phpinfo_as_text = 1; sapi_module->php_ini_ignore_cwd = 1; sapi_startup(sapi_module); + sapi_started = 1; sapi_module->php_ini_ignore = ini_ignore; @@ -1364,7 +1365,9 @@ out: if (module_started) { php_module_shutdown(TSRMLS_C); } - sapi_shutdown(); + if (sapi_started) { + sapi_shutdown(); + } #ifdef ZTS tsrm_shutdown(); #endif |