@@ -1153,6 +1153,7 @@ static void init_request_info(void)
11531153 }
11541154
11551155 if (tflag ) {
1156+ char * decoded_path_info = NULL ;
11561157 if (orig_path_info ) {
11571158 char old ;
11581159
@@ -1174,7 +1175,6 @@ static void init_request_info(void)
11741175 * As we can extract PATH_INFO from PATH_TRANSLATED
11751176 * it is probably also in SCRIPT_NAME and need to be removed
11761177 */
1177- char * decoded_path_info = NULL ;
11781178 size_t decoded_path_info_len = 0 ;
11791179 if (strchr (path_info , '%' )) {
11801180 decoded_path_info = estrdup (path_info );
@@ -1197,11 +1197,13 @@ static void init_request_info(void)
11971197 env_script_name [env_script_file_info_start ] = 0 ;
11981198 SG (request_info ).request_uri = FCGI_PUTENV (request , "SCRIPT_NAME" , env_script_name );
11991199 }
1200- if (decoded_path_info ) {
1201- efree (decoded_path_info );
1202- }
12031200 }
1204- env_path_info = FCGI_PUTENV (request , "PATH_INFO" , path_info );
1201+ if (decoded_path_info ) {
1202+ env_path_info = FCGI_PUTENV (request , "PATH_INFO" , decoded_path_info );
1203+ efree (decoded_path_info );
1204+ } else {
1205+ env_path_info = FCGI_PUTENV (request , "PATH_INFO" , path_info );
1206+ }
12051207 }
12061208 if (!orig_script_filename ||
12071209 strcmp (orig_script_filename , pt ) != 0 ) {
0 commit comments