File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -1056,15 +1056,18 @@ PHP_FUNCTION(proc_open)
1056
1056
/* Automatically bypass shell if command is given as an array */
1057
1057
bypass_shell = 1 ;
1058
1058
command_str = create_win_command_from_args (command_ht );
1059
- if (!command_str ) {
1060
- RETURN_FALSE ;
1061
- }
1062
1059
#else
1063
1060
command_str = get_command_from_array (command_ht , & argv , num_elems );
1061
+ #endif
1062
+
1064
1063
if (!command_str ) {
1065
- goto exit_fail ;
1066
- }
1064
+ #ifndef PHP_WIN32
1065
+ efree_argv ( argv );
1067
1066
#endif
1067
+ RETURN_FALSE ;
1068
+ }
1069
+ } else {
1070
+ zend_string_addref (command_str );
1068
1071
}
1069
1072
1070
1073
#ifdef PHP_WIN32
@@ -1307,11 +1310,7 @@ PHP_FUNCTION(proc_open)
1307
1310
RETVAL_FALSE ;
1308
1311
}
1309
1312
1310
- /* the command_str needs to be freed if it was created by parsing an array */
1311
- if (command_ht && command_str ) {
1312
- zend_string_release_ex (command_str , false);
1313
- }
1314
-
1313
+ zend_string_release_ex (command_str , false);
1315
1314
#ifdef PHP_WIN32
1316
1315
free (cwdw );
1317
1316
free (cmdw );
You can’t perform that action at this time.
0 commit comments