]> granicus.if.org Git - php/commitdiff
MFH: fixed leaks that occurs if the third parameter already contains a valid
authorMoriyoshi Koizumi <moriyoshi@php.net>
Sun, 13 Jul 2003 19:46:39 +0000 (19:46 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Sun, 13 Jul 2003 19:46:39 +0000 (19:46 +0000)
value.

ext/standard/exec.c

index 4645cea88c174893d30936c2bb3dfebae68070db..4c573c6032000331adf76d4c6ce231ba0e3b4c94 100644 (file)
@@ -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