From ac58d21aa38ca00ab9698cecfa05c8e0ff1e8d4a Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Sun, 25 Oct 2015 18:47:50 +0100 Subject: [PATCH] Fix refcount reaching 2^32 - 1 for resources Happens e.g. in proc_close() when nothing is referencing the file handles, e.g. they have refcount 0 when passed to zend_list_close() and then zend_list_delete() which decrements it to (uint32_t) -1 --- Zend/zend_list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Zend/zend_list.c b/Zend/zend_list.c index e38246ee871..d86f8ae4745 100644 --- a/Zend/zend_list.c +++ b/Zend/zend_list.c @@ -84,7 +84,7 @@ static void zend_resource_dtor(zend_resource *res) ZEND_API int zend_list_close(zend_resource *res) { if (GC_REFCOUNT(res) <= 0) { - return zend_list_delete(res); + return zend_list_free(res); } else if (res->type >= 0) { zend_resource_dtor(res); }