mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fixed leaks that occurs if the third parameter already contains a valid value.
This commit is contained in:
parent
f9551bc554
commit
cd52986a5c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user