From: Moriyoshi Koizumi Date: Sat, 12 Jul 2003 06:50:32 +0000 (+0000) Subject: Fixed leaks that occurs if the third parameter already contains a valid value. X-Git-Tag: BEFORE_ARG_INFO~276 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cd52986a5c292f737e0309c77edff6d112dc3270;p=php Fixed leaks that occurs if the third parameter already contains a valid value. --- 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