From: Dmitry Stogov Date: Fri, 7 Apr 2006 12:39:43 +0000 (+0000) Subject: Removed unnecessary copying X-Git-Tag: php-5.1.3RC3~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8c40d605e4f397899c8e111765a86a012c9f9db1;p=php Removed unnecessary copying --- diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 522cfd133b..77df4f6263 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -433,7 +433,7 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) { if (!FCGX_IsCGI()) { FCGX_Request *request = (FCGX_Request *) SG(server_context); - char **env, *p, *t; + char **env, *p; int magic_quotes_gpc = PG(magic_quotes_gpc); /* turn off magic_quotes while importing environment variables */ @@ -443,9 +443,9 @@ void cgi_php_import_environment_variables(zval *array_ptr TSRMLS_DC) if (!p) { /* malformed entry? */ continue; } - t = estrndup(*env, p - *env); - php_register_variable(t, p + 1, array_ptr TSRMLS_CC); - efree(t); + *p = 0; + php_register_variable(*env, p + 1, array_ptr TSRMLS_CC); + *p = '='; } PG(magic_quotes_gpc) = magic_quotes_gpc; }