From: Moriyoshi Koizumi Date: Sun, 13 Jul 2003 19:46:39 +0000 (+0000) Subject: MFH: fixed leaks that occurs if the third parameter already contains a valid X-Git-Tag: php-4.3.3RC2~124 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c4ab6c2cad0233440202cc62c32bd8bc2e7f67d8;p=php MFH: fixed leaks that occurs if the third parameter already contains a valid value. --- diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 4645cea88c..4c573c6032 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -690,7 +690,7 @@ PHP_FUNCTION(proc_open) pid_t child; #endif - if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz/", &command, + if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "saz", &command, &command_len, &descriptorspec, &pipes) == FAILURE) { RETURN_FALSE; } @@ -941,6 +941,10 @@ PHP_FUNCTION(proc_open) /* we forked/spawned and this is the parent */ efree(command); + + if (pipes != NULL) { + zval_dtor(pipes); + } array_init(pipes); /* clean up all the child ends and then open streams on the parent