File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -586,12 +586,20 @@ static char *sapi_fcgi_getenv(char *name, size_t name_len)
586
586
fcgi_request * request = (fcgi_request * ) SG (server_context );
587
587
char * ret = fcgi_getenv (request , name , (int )name_len );
588
588
589
+ #ifndef PHP_WIN32
589
590
if (ret ) return ret ;
590
591
/* if cgi, or fastcgi and not found in fcgi env
591
592
check the regular environment */
592
- #ifndef PHP_WIN32
593
593
return getenv (name );
594
594
#else
595
+ if (ret ) {
596
+ /* The functions outside here don't know, where does it come
597
+ from. They'll need to free the returned memory as it's
598
+ not necessary from the fcgi env. */
599
+ return strdup (ret );
600
+ }
601
+ /* if cgi, or fastcgi and not found in fcgi env
602
+ check the regular environment */
595
603
return cgi_getenv_win32 (name , name_len );
596
604
#endif
597
605
}
You can’t perform that action at this time.
0 commit comments