From c4ab6c2cad0233440202cc62c32bd8bc2e7f67d8 Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Sun, 13 Jul 2003 19:46:39 +0000 Subject: [PATCH] MFH: fixed leaks that occurs if the third parameter already contains a valid value. --- ext/standard/exec.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- 2.40.0