From: Anatol Belski <ab@php.net>
Date: Mon, 4 Dec 2017 13:11:40 +0000 (+0100)
Subject: Use dtor unconditionally in error case
X-Git-Tag: php-7.0.27RC1~2
X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0eb262eacb834c15c669cee19051f07bdc48ddd3;p=php

Use dtor unconditionally in error case
---

diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 54f093ae10..791ae1ccfa 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -603,12 +603,12 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_
 			goto exit;
 		} else {
 			if (Z_STRVAL_P(member)[0] == '\0') {
+				zval_ptr_dtor(&tmp_object);
 				if (Z_STRLEN_P(member) == 0) {
 					zend_throw_error(NULL, "Cannot access empty property");
 					retval = &EG(uninitialized_zval);
 					goto exit;
 				} else {
-					zval_ptr_dtor(&tmp_object);
 					zend_throw_error(NULL, "Cannot access property started with '\\0'");
 					retval = &EG(uninitialized_zval);
 					goto exit;