moriyoshi               Sat Jul 12 02:50:32 2003 EDT

  Modified files:              
    /php-src/ext/standard       proc_open.c 
  Log:
  Fixed leaks that occurs if the third parameter already contains a valid value.
  
  
Index: php-src/ext/standard/proc_open.c
diff -u php-src/ext/standard/proc_open.c:1.12 php-src/ext/standard/proc_open.c:1.13
--- php-src/ext/standard/proc_open.c:1.12       Tue Jun 10 16:03:38 2003
+++ php-src/ext/standard/proc_open.c    Sat Jul 12 02:50:32 2003
@@ -15,7 +15,7 @@
    | Author: Wez Furlong <[EMAIL PROTECTED]>                           |
    +----------------------------------------------------------------------+
  */
-/* $Id: proc_open.c,v 1.12 2003/06/10 20:03:38 imajes Exp $ */
+/* $Id: proc_open.c,v 1.13 2003/07/12 06:50:32 moriyoshi Exp $ */
 
 #include <stdio.h>
 #include "php.h"
@@ -470,7 +470,7 @@
        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 @@
        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



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to