mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Merge branch 'PHP-7.2'
* PHP-7.2: Fix invalid free
This commit is contained in:
commit
50431d0820
1 changed files with 9 additions and 1 deletions
|
@ -586,12 +586,20 @@ static char *sapi_fcgi_getenv(char *name, size_t name_len)
|
|||
fcgi_request *request = (fcgi_request*) SG(server_context);
|
||||
char *ret = fcgi_getenv(request, name, (int)name_len);
|
||||
|
||||
#ifndef PHP_WIN32
|
||||
if (ret) return ret;
|
||||
/* if cgi, or fastcgi and not found in fcgi env
|
||||
check the regular environment */
|
||||
#ifndef PHP_WIN32
|
||||
return getenv(name);
|
||||
#else
|
||||
if (ret) {
|
||||
/* The functions outside here don't know, where does it come
|
||||
from. They'll need to free the returned memory as it's
|
||||
not necessary from the fcgi env. */
|
||||
return strdup(ret);
|
||||
}
|
||||
/* if cgi, or fastcgi and not found in fcgi env
|
||||
check the regular environment */
|
||||
return cgi_getenv_win32(name, name_len);
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue