cvs: php4 /sapi/cgi cgi_main.c

From: Date: Sat, 22 Jun 2002 13:53:44 +0000
Subject: cvs: php4 /sapi/cgi cgi_main.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-12440@lists.php.net to get a copy of this message
andi Sat Jun 22 09:53:44 2002 EDT Modified files: /php4/sapi/cgi cgi_main.c Log: - Stop using persist_alloc(). Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.171 php4/sapi/cgi/cgi_main.c:1.172 --- php4/sapi/cgi/cgi_main.c:1.171 Sun May 26 09:12:30 2002 +++ php4/sapi/cgi/cgi_main.c Sat Jun 22 09:53:44 2002 @@ -1062,13 +1062,24 @@ #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 @@ 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();

« previous php.cvs (#12440) next »