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