From: Dmitry Stogov Date: Wed, 9 Apr 2014 14:11:18 +0000 (+0400) Subject: Fixed reference counting X-Git-Tag: POST_PHPNG_MERGE~412^2~139 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b1d2efcc2d3f79016698a3b5091c9be0b7274876;p=php Fixed reference counting --- diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index a72184c7df..fd3e0c2937 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -216,7 +216,9 @@ 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]); + if (--GC_REFCOUNT(proc->pipes[i]) <= 0) { + zend_list_delete(proc->pipes[i]); + } proc->pipes[i] = 0; } }