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 @@ -1060,15 +1060,18 @@ PHP_FUNCTION(proc_open)
1060
1060
/* Automatically bypass shell if command is given as an array */
1061
1061
bypass_shell = 1 ;
1062
1062
command_str = create_win_command_from_args (command_ht );
1063
- if (!command_str ) {
1064
- RETURN_FALSE ;
1065
- }
1066
1063
#else
1067
1064
command_str = get_command_from_array (command_ht , & argv , num_elems );
1065
+ #endif
1066
+
1068
1067
if (!command_str ) {
1069
- goto exit_fail ;
1070
- }
1068
+ #ifndef PHP_WIN32
1069
+ efree_argv ( argv );
1071
1070
#endif
1071
+ RETURN_FALSE ;
1072
+ }
1073
+ } else {
1074
+ zend_string_addref (command_str );
1072
1075
}
1073
1076
1074
1077
#ifdef PHP_WIN32
@@ -1311,11 +1314,7 @@ PHP_FUNCTION(proc_open)
1311
1314
RETVAL_FALSE ;
1312
1315
}
1313
1316
1314
- /* the command_str needs to be freed if it was created by parsing an array */
1315
- if (command_ht && command_str ) {
1316
- zend_string_release_ex (command_str , false);
1317
- }
1318
-
1317
+ zend_string_release_ex (command_str , false);
1319
1318
#ifdef PHP_WIN32
1320
1319
free (cwdw );
1321
1320
free (cmdw );
You can’t perform that action at this time.
0 commit comments