summaryrefslogtreecommitdiff
path: root/ext/standard/proc_open.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2019-01-07 12:28:51 +0100
committerNikita Popov <nikita.ppv@gmail.com>2019-01-11 15:49:06 +0100
commite219ec144ef6682b71e135fd18654ee1bb4676b4 (patch)
treee4a3ae2b619cdc9fe50ee8e1fa5adb99d804dddf /ext/standard/proc_open.c
parentfe8fdfa3bd588d80ce60f6b3848058239e0a760f (diff)
downloadphp-git-e219ec144ef6682b71e135fd18654ee1bb4676b4.tar.gz
Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2 This is a squash of PR #3734, which is a squash of PR #3313. Co-authored-by: Bob Weinand <bobwei9@hotmail.com> Co-authored-by: Joe Watkins <krakjoe@php.net> Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Diffstat (limited to 'ext/standard/proc_open.c')
-rw-r--r--ext/standard/proc_open.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 612cdf0f88..8347ea7864 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -447,7 +447,7 @@ PHP_FUNCTION(proc_open)
ZEND_PARSE_PARAMETERS_START(3, 6)
Z_PARAM_STRING(command, command_len)
Z_PARAM_ARRAY(descriptorspec)
- Z_PARAM_ZVAL_DEREF(pipes)
+ Z_PARAM_ZVAL(pipes)
Z_PARAM_OPTIONAL
Z_PARAM_STRING_EX(cwd, cwd_len, 1, 0)
Z_PARAM_ARRAY_EX(environment, 1, 0)
@@ -862,6 +862,11 @@ PHP_FUNCTION(proc_open)
#endif
/* we forked/spawned and this is the parent */
+ pipes = zend_try_array_init(pipes);
+ if (!pipes) {
+ goto exit_fail;
+ }
+
proc = (struct php_process_handle*)pemalloc(sizeof(struct php_process_handle), is_persistent);
proc->is_persistent = is_persistent;
proc->command = command;
@@ -873,9 +878,6 @@ PHP_FUNCTION(proc_open)
#endif
proc->env = env;
- zval_ptr_dtor(pipes);
- array_init(pipes);
-
#if PHP_CAN_DO_PTS
if (dev_ptmx >= 0) {
close(dev_ptmx);