]> granicus.if.org Git - php/commitdiff
Fix proc_open resource destruction
authorNikita Popov <nikic@php.net>
Thu, 8 May 2014 22:24:01 +0000 (00:24 +0200)
committerNikita Popov <nikic@php.net>
Thu, 8 May 2014 22:24:01 +0000 (00:24 +0200)
ext/standard/proc_open.c

index 2fb5553cdee71a74d84bba595c69c8ee4456214c..35ea3d1b743b90dccbedfcbac05b614a7353cf5b 100644 (file)
@@ -222,7 +222,8 @@ static void proc_open_rsrc_dtor(zend_resource *rsrc TSRMLS_DC)
        /* Close all handles to avoid a deadlock */
        for (i = 0; i < proc->npipes; i++) {
                if (proc->pipes[i] != 0) {
-                       zend_list_delete(proc->pipes[i]);
+                       GC_REFCOUNT(proc->pipes[i])--;
+                       zend_list_close(proc->pipes[i]);
                        proc->pipes[i] = 0;
                }
        }
@@ -318,7 +319,7 @@ PHP_FUNCTION(proc_close)
        ZEND_FETCH_RESOURCE(proc, struct php_process_handle *, zproc, -1, "process", le_proc_open);
 
        FG(pclose_wait) = 1;
-       zend_list_delete(Z_RES_P(zproc));
+       zend_list_close(Z_RES_P(zproc));
        FG(pclose_wait) = 0;
        RETURN_LONG(FG(pclose_ret));
 }