summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorAndi Gutmans <andi@php.net>2002-06-22 13:53:44 +0000
committerAndi Gutmans <andi@php.net>2002-06-22 13:53:44 +0000
commit42163791522091e26607bcb1c3bce3e26b6dda07 (patch)
treeb3414c71a2971b9de7f29531d7033f984b08e018 /sapi/cgi/cgi_main.c
parentb53569c9e8522039f1b7b0154192f44dbb347ccc (diff)
downloadphp-git-42163791522091e26607bcb1c3bce3e26b6dda07.tar.gz
- Stop using persist_alloc().
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c26
1 files changed, 20 insertions, 6 deletions
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();