php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60598
Patch bug60598 revision 2013-08-29 11:09 UTC by laruence@php.net

Patch bug60598 for Reproducible crash Bug #60598

Patch version 2013-08-29 11:09 UTC

Return to Bug #60598 | Download this patch
Patch Revisions:

Developer: laruence@php.net

diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index 1fe5d0c..b5dd48f 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -57,6 +57,11 @@ ZEND_API void zend_objects_store_call_destructors(zend_objects_store *objects TS
 					obj->dtor(obj->object, i TSRMLS_CC);
 					obj = &objects->object_buckets[i].bucket.obj;
 					obj->refcount--;
+
+					if (obj->refcount == 0) {
+						/* in case gc_collect_cycle is triggered before free_storage */
+						GC_REMOVE_ZOBJ_FROM_BUFFER(obj);
+					}
 				}
 			}
 		}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 15:01:30 2024 UTC