1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

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
This commit is contained in:
Bob Weinand
2015-10-25 18:47:50 +01:00
parent a0665f3a18
commit ac58d21aa3

View File

@@ -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);
}