From: Dmitry Stogov Date: Thu, 22 Dec 2005 09:31:40 +0000 (+0000) Subject: Fixed memory leak and typo X-Git-Tag: RELEASE_1_0_4~269 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69200c9baf9d4c675356fa81b668b334566c6803;p=php Fixed memory leak and typo --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 3f26ba2d2d..dc4f2bd3f6 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -458,12 +458,13 @@ static inline void make_real_object(zval **object_ptr TSRMLS_DC) /* this should modify object only if it's empty */ if ((*object_ptr)->type == IS_NULL || ((*object_ptr)->type == IS_BOOL && (*object_ptr)->value.lval==0) - || (((*object_ptr)->type == IS_STRING && (*object_ptr)->type == IS_BINARY) && (*object_ptr)->value.str.len == 0) + || (((*object_ptr)->type == IS_STRING || (*object_ptr)->type == IS_BINARY) && (*object_ptr)->value.str.len == 0) || ((*object_ptr)->type == IS_UNICODE && (*object_ptr)->value.ustr.len == 0)) { if (!PZVAL_IS_REF(*object_ptr)) { SEPARATE_ZVAL(object_ptr); } zend_error(E_STRICT, "Creating default object from empty value"); + zval_dtor(*object_ptr); object_init(*object_ptr); } }