summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2018-07-05 14:25:17 +0300
committerDmitry Stogov <dmitry@zend.com>2018-07-05 14:25:17 +0300
commit3780b027ddce2e7dfb62228c89162480d8fbd5ff (patch)
treeafa278f6a8e83b465200e77e2539c31a40a6ec57
parent91fc0d1a4146eb44dc2b668e65aef9bbec4e071b (diff)
downloadphp-git-3780b027ddce2e7dfb62228c89162480d8fbd5ff.tar.gz
Use zval_ptr_dtor() instead of zval_dtor() in internal functions that destroy new created object (This is safer and produces less code)
-rw-r--r--ext/phar/phar_object.c4
-rw-r--r--ext/reflection/php_reflection.c4
2 files changed, 4 insertions, 4 deletions
diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c
index f2fd426241..2e351454f3 100644
--- a/ext/phar/phar_object.c
+++ b/ext/phar/phar_object.c
@@ -1767,7 +1767,7 @@ PHP_METHOD(Phar, buildFromDirectory)
if (SUCCESS != object_init_ex(&regexiter, spl_ce_RegexIterator)) {
zval_ptr_dtor(&iteriter);
- zval_dtor(&regexiter);
+ zval_ptr_dtor(&regexiter);
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate regex iterator for %s", phar_obj->archive->fname);
RETURN_FALSE;
}
@@ -2218,7 +2218,7 @@ its_ok:
ZVAL_NULL(&ret);
if (SUCCESS != object_init_ex(&ret, ce)) {
- zval_dtor(&ret);
+ zval_ptr_dtor(&ret);
zend_throw_exception_ex(spl_ce_BadMethodCallException, 0, "Unable to instantiate phar object when converting archive \"%s\"", phar->fname);
return NULL;
}
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index e57c388e4a..c29c354365 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -4127,7 +4127,7 @@ ZEND_METHOD(reflection_class, getMethod)
/* don't assign closure_object since we only reflect the invoke handler
method and not the closure definition itself */
reflection_method_factory(ce, mptr, NULL, return_value);
- zval_dtor(&obj_tmp);
+ zval_ptr_dtor(&obj_tmp);
efree(lc_name);
} else if ((mptr = zend_hash_str_find_ptr(&ce->function_table, lc_name, name_len)) != NULL) {
reflection_method_factory(ce, mptr, NULL, return_value);
@@ -4571,7 +4571,7 @@ ZEND_METHOD(reflection_class, isCloneable)
return;
}
RETVAL_BOOL(Z_OBJ_HANDLER(obj, clone_obj) != NULL);
- zval_dtor(&obj);
+ zval_ptr_dtor(&obj);
}
}
}