From 357ee4305ea75e40991590d2d3425689f5defb68 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Thu, 28 Apr 2016 19:19:28 +0200 Subject: [PATCH] Fix leak in guards patch --- Zend/zend_object_handlers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index ca6ec6ac7e..c74ef7508d 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -543,7 +543,9 @@ static uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member) ALLOC_HASHTABLE(guards); zend_hash_init(guards, 8, NULL, zend_property_guard_dtor, 0); /* mark pointer as "special" using low bit */ - zend_hash_add_new_ptr(guards, member, (void*)(((zend_uintptr_t)&zv->u2.property_guard) | 1)); + zend_hash_add_new_ptr(guards, member, + (void*)(((zend_uintptr_t)&zv->u2.property_guard) | 1)); + zend_string_release(Z_STR_P(zv)); ZVAL_ARR(zv, guards); } } else if (EXPECTED(Z_TYPE_P(zv) == IS_ARRAY)) { -- 2.40.0