summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2003-07-12 06:50:32 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2003-07-12 06:50:32 +0000
commitcd52986a5c292f737e0309c77edff6d112dc3270 (patch)
tree9b1669d74343a73c220688fca11bf7098e62e858
parentf9551bc5540c3ed18f64b01f4788c5d477b0f521 (diff)
downloadphp-git-cd52986a5c292f737e0309c77edff6d112dc3270.tar.gz
Fixed leaks that occurs if the third parameter already contains a valid value.
-rw-r--r--ext/standard/proc_open.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 15c3eac607..ce29086598 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -470,7 +470,7 @@ PHP_FUNCTION(proc_open)
struct php_process_handle *proc;
int is_persistent = 0; /* TODO: ensure that persistent procs will work */
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz/|s!a!", &command,
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz|s!a!", &command,
&command_len, &descriptorspec, &pipes, &cwd, &cwd_len, &environment) == FAILURE) {
RETURN_FALSE;
}
@@ -737,6 +737,10 @@ PHP_FUNCTION(proc_open)
proc->child = child;
proc->env = env;
+ if (pipes != NULL) {
+ zval_dtor(pipes);
+ }
+ MAKE_STD_ZVAL(pipes);
array_init(pipes);
/* clean up all the child ends and then open streams on the parent