From: Andi Gutmans Date: Sat, 22 Jun 2002 13:53:44 +0000 (+0000) Subject: - Stop using persist_alloc(). X-Git-Tag: php-4.3.0dev_zend2_alpha2~158 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=42163791522091e26607bcb1c3bce3e26b6dda07;p=php - Stop using persist_alloc(). --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index f142426ebb..1f18c5d8c9 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -1062,13 +1062,24 @@ consult the installation file that came with this distribution, or visit \n\ #endif } - if (SG(request_info).path_translated) { - persist_alloc(SG(request_info).path_translated); - } - - php_request_shutdown((void *) 0); + { + char *path_translated; + + /* Go through this trouble so that the memory manager doesn't warn + * about SG(request_info).path_translated leaking + */ + if (SG(request_info).path_translated) { + path_translated = strdup(SG(request_info).path_translated); + STR_FREE(SG(request_info).path_translated); + SG(request_info).path_translated = path_translated; + } + + php_request_shutdown((void *) 0); - STR_FREE(SG(request_info).path_translated); + if (SG(request_info).path_translated) { + free(SG(request_info).path_translated); + } + } #ifdef PHP_FASTCGI if (!fastcgi) break; @@ -1092,11 +1103,14 @@ consult the installation file that came with this distribution, or visit \n\ if (cgi_sapi_module.php_ini_path_override) { free(cgi_sapi_module.php_ini_path_override); } + } zend_catch { exit_status = 255; } zend_end_try(); + php_module_shutdown(TSRMLS_C); + return SUCCESS; #ifdef ZTS tsrm_shutdown();