From 9781bf59cb821bbde261d6bbc430c841eadb4b9d Mon Sep 17 00:00:00 2001 From: Andrei Zmievski Date: Tue, 23 Nov 1999 20:25:55 +0000 Subject: [PATCH] (main) In this special case, free path_translated. Fix for #2795. --- sapi/cgi/cgi_main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 2512a2083f..3ed12fe4d5 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -221,6 +221,7 @@ int main(int argc, char *argv[]) int cgi_started=0; int behavior=PHP_MODE_STANDARD; int no_headers=0; + int free_path_translated=0; #if SUPPORT_INTERACTIVE int interactive=0; #endif @@ -320,6 +321,7 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine } cgi_started=1; SG(request_info).path_translated = estrdup(optarg); + free_path_translated=1; /* break missing intentionally */ case 'q': no_headers = 1; @@ -488,6 +490,8 @@ any .htaccess restrictions anywhere on your site you can leave doc_root undefine } php3_header(); /* Make sure headers have been sent */ + if (free_path_translated) + efree(SG(request_info).path_translated); php_request_shutdown((void *) 0); php_module_shutdown(); #ifdef ZTS -- 2.40.0