From 3ada78d4088e23238c27a217b00dd6ac60cd31ff Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Fri, 7 Apr 2006 12:39:28 +0000 Subject: Removed unnecessary copying --- sapi/cgi/cgi_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index e711be4374..37ddb93956 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -412,16 +412,16 @@ 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; for (env = request->envp; env != NULL && *env != NULL; env++) { p = strchr(*env, '='); 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 = '='; } } /* call php's original import as a catch-all */ -- cgit v1.2.1