php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #63726
Patch bug63726.patch revision 2012-12-10 11:30 UTC by laruence@php.net
revision 2012-12-09 13:20 UTC by laruence@php.net
revision 2012-12-09 13:07 UTC by laruence@php.net

Patch bug63726.patch for Scripting Engine problem Bug #63726

Patch version 2012-12-09 13:07 UTC

Return to Bug #63726 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: laruence@php.net

diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index c3d62c2..cd6684f 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -3708,6 +3708,8 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, const char *na
 				(*property)->value = value->value;
 				if (Z_REFCOUNT_P(value) > 0) {
 					zval_copy_ctor(*property);
+				} else if (Z_REFCOUNT_P(value) == 0) {
+					efree(value);
 				}
 			} else {
 				zval *garbage = *property;
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index d82493a..c861565 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -539,6 +539,8 @@ ZEND_API void zend_std_write_property(zval *object, zval *member, zval *value, c
 				(*variable_ptr)->value = value->value;
 				if (Z_REFCOUNT_P(value) > 0) {
 					zval_copy_ctor(*variable_ptr);
+				} else if (Z_REFCOUNT_P(value) == 0) {
+					efree(value);
 				}
 				zval_dtor(&garbage);
 			} else {
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 13:01:30 2024 UTC